[Libreoffice-commits] core.git: vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Thu Jun 15 19:19:31 UTC 2017


 vcl/source/app/svmain.cxx |   18 +++++++++++++++++-
 vcl/unx/gtk/gtkinst.cxx   |    6 ------
 2 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 9eb919628fce98b5e7a8b3262d76a8b0e8cc01c4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 30 12:27:08 2017 +0100

    make LANGUAGE setting universal, not just gtk specific
    
    Change-Id: I845e808be27e2fad959a73d0d34a204b4bdcdd1f
    Reviewed-on: https://gerrit.libreoffice.org/38211
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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();
 }
 


More information about the Libreoffice-commits mailing list