summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-05-30 12:27:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-15 21:19:07 +0200
commit9eb919628fce98b5e7a8b3262d76a8b0e8cc01c4 (patch)
tree3d4f2bf9f272af9df7d5f56e3680931552fdcd89 /vcl
parent619d93c8f660b26e19f41c6908807819ac783958 (diff)
make LANGUAGE setting universal, not just gtk specific
Change-Id: I845e808be27e2fad959a73d0d34a204b4bdcdd1f Reviewed-on: https://gerrit.libreoffice.org/38211 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/svmain.cxx18
-rw-r--r--vcl/unx/gtk/gtkinst.cxx6
2 files changed, 17 insertions, 7 deletions
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2a89d80f60f3..672618bd5712 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -313,10 +313,26 @@ bool InitVCL()
new DesktopEnvironmentContext( css::uno::getCurrentContext() ) );
// Initialize application instance (should be done after initialization of VCL SAL part)
- if( pSVData->mpApp )
+ if (pSVData->mpApp)
+ {
// call init to initialize application class
// soffice/sfx implementation creates the global service manager
pSVData->mpApp->Init();
+ }
+
+ if (pSVData->maAppData.mpSettings)
+ {
+ //Now that uno has been bootstrapped we can ask the config what the UI language is so that we can
+ //force that in as $LANGUAGE. That way we can get gtk to render widgets RTL
+ //if we have a RTL UI in an otherwise LTR locale and get gettext using externals (e.g. python)
+ //to match their translations to our preferred UI language
+ OUString aLocaleString(pSVData->maAppData.mpSettings->GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
+ if (!aLocaleString.isEmpty())
+ {
+ OUString envVar("LANGUAGE");
+ osl_setEnvironment(envVar.pData, aLocaleString.pData);
+ }
+ }
pSVData->mpDefInst->AfterAppInit();
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
index e01a267b6131..a22ea9c93f87 100644
--- a/vcl/unx/gtk/gtkinst.cxx
+++ b/vcl/unx/gtk/gtkinst.cxx
@@ -167,12 +167,6 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
//UI in a LTR locale
void GtkInstance::AfterAppInit()
{
- OUString aLocaleString(Application::GetSettings().GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
- if (!aLocaleString.isEmpty())
- {
- OUString envVar("LANGUAGE");
- osl_setEnvironment(envVar.pData, aLocaleString.pData);
- }
EnsureInit();
}