diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-30 12:27:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-15 21:19:07 +0200 |
commit | 9eb919628fce98b5e7a8b3262d76a8b0e8cc01c4 (patch) | |
tree | 3d4f2bf9f272af9df7d5f56e3680931552fdcd89 /vcl/source | |
parent | 619d93c8f660b26e19f41c6908807819ac783958 (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/source')
-rw-r--r-- | vcl/source/app/svmain.cxx | 18 |
1 files changed, 17 insertions, 1 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(); |