summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-05-30 09:44:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-05-30 09:50:22 +0100
commitf55eeb7a45998d16eb0fe49088e172ce45ac4f2b (patch)
treefb7d3a589ca7f0760526c9d75f63d7accf98d139
parent1c965f6aec81816170aaf8f9fa378ab6adcb91af (diff)
make LANGUAGE setting universal, not just gtk specific
Change-Id: I5ff01f0232391933ad3704af6f2c2100d923c1fd
-rw-r--r--vcl/source/app/svmain.cxx11
-rw-r--r--vcl/unx/gtk/gtkinst.cxx6
2 files changed, 11 insertions, 6 deletions
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2a89d80f60f3..0e0a2a9bbbff 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -318,6 +318,17 @@ bool InitVCL()
// soffice/sfx implementation creates the global service manager
pSVData->mpApp->Init();
+ //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(Application::GetSettings().GetUILanguageTag().getGlibcLocaleString(".UTF-8"));
+ if (!aLocaleString.isEmpty())
+ {
+ OUString envVar("LANGUAGE");
+ osl_setEnvironment(envVar.pData, aLocaleString.pData);
+ }
+
pSVData->mpDefInst->AfterAppInit();
// Fetch AppFileName and make it absolute before the workdir changes...
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();
}