[Libreoffice-commits] core.git: cui/source cui/uiconfig solenv/sanitizers

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 8 14:42:52 UTC 2018


 cui/source/dialogs/about.cxx   |   23 ++++++++++++++---------
 cui/source/inc/about.hxx       |    1 +
 cui/uiconfig/ui/aboutdialog.ui |   15 ++++++++++++++-
 solenv/sanitizers/ui/cui.suppr |    1 +
 4 files changed, 30 insertions(+), 10 deletions(-)

New commits:
commit 396d29d9deccef6fa4ecf9ea8aa6a5d6f6065c53
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 8 11:24:15 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 8 15:40:59 2018 +0100

    Related: tdf#121238 show ui language as well as locale
    
    Change-Id: I350c71f50fdb8f0602badd7a7ad13b3a7c2c85e0
    Reviewed-on: https://gerrit.libreoffice.org/63083
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 5a564389f590..648073c75f4c 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -81,6 +81,7 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
     m_aBasedTextStr = get<FixedText>("libreoffice")->GetText();
     m_aBasedDerivedTextStr = get<FixedText>("derived")->GetText();
     m_aLocaleStr = get<FixedText>("locale")->GetText();
+    m_aUILocaleStr = get<FixedText>("uilocale")->GetText();
     m_buildIdLinkString = m_pBuildIdLink->GetText();
 
     m_pVersion->SetText(GetVersionString());
@@ -307,6 +308,7 @@ OUString AboutDialog::GetVersionString()
     OUString sBuildId = GetBuildId();
 
     OUString aLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" + GetLocaleString() + ")";
+    OUString aUILocaleStr = Application::GetSettings().GetUILanguageTag().getBcp47();
 
     if (!sBuildId.trim().isEmpty())
     {
@@ -328,16 +330,19 @@ OUString AboutDialog::GetVersionString()
         sVersion += "\n" EXTRA_BUILDID;
     }
 
-    if (!aLocaleStr.trim().isEmpty())
+    if (m_aLocaleStr.indexOf("$LOCALE") == -1)
     {
-        sVersion += "\n";
-        if (m_aLocaleStr.indexOf("$LOCALE") == -1)
-        {
-            SAL_WARN( "cui.dialogs", "translated locale string in translations doesn't contain $LOCALE placeholder" );
-            m_aLocaleStr += " $LOCALE";
-        }
-        sVersion += m_aLocaleStr.replaceAll("$LOCALE", aLocaleStr);
+        SAL_WARN( "cui.dialogs", "translated locale string in translations doesn't contain $LOCALE placeholder" );
+        m_aLocaleStr += " $LOCALE";
+    }
+    sVersion += "\n" + m_aLocaleStr.replaceAll("$LOCALE", aLocaleStr);
+
+    if (m_aUILocaleStr.indexOf("$LOCALE") == -1)
+    {
+        SAL_WARN( "cui.dialogs", "translated uilocale string in translations doesn't contain $LOCALE placeholder" );
+        m_aUILocaleStr += " $LOCALE";
     }
+    sVersion += "; " + m_aUILocaleStr.replaceAll("$LOCALE", aUILocaleStr);
 
     OUString aCalcMode = "Calc: "; // Calc calculation mode
 
@@ -359,7 +364,7 @@ OUString AboutDialog::GetVersionString()
         aCalcMode += "threaded";
     }
 
-    sVersion += "; " + aCalcMode;
+    sVersion += "\n" + aCalcMode;
 
     return sVersion;
 }
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 9ea511c4488b..9885cdec7d47 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -52,6 +52,7 @@ private:
     OUString m_aCreditsLinkStr;
     OUString m_sBuildStr;
     OUString m_aLocaleStr;
+    OUString m_aUILocaleStr;
     OUString m_buildIdLinkString;
 
     void SetBuildIdLink();
diff --git a/cui/uiconfig/ui/aboutdialog.ui b/cui/uiconfig/ui/aboutdialog.ui
index 2d279b14379b..ac2746111731 100644
--- a/cui/uiconfig/ui/aboutdialog.ui
+++ b/cui/uiconfig/ui/aboutdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkTextBuffer" id="textbuffer1">
@@ -162,6 +162,19 @@
                         <property name="top_attach">0</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkLabel" id="uilocale">
+                        <property name="can_focus">False</property>
+                        <property name="no_show_all">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="label" translatable="yes" context="aboutdialog|locale">UI-Language: $LOCALE</property>
+                        <property name="justify">center</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">3</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr
index 827ff319ed1e..46597941bb8d 100644
--- a/solenv/sanitizers/ui/cui.suppr
+++ b/solenv/sanitizers/ui/cui.suppr
@@ -2,6 +2,7 @@ cui/uiconfig/ui/aboutdialog.ui://GtkImage[@id='logo'] no-labelled-by
 cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='logoreplacement'] orphan-label
 cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='buildid'] orphan-label
 cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='locale'] orphan-label
+cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='uilocale'] orphan-label
 cui/uiconfig/ui/aboutdialog.ui://GtkTextView[@id='version'] no-labelled-by
 cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='description'] orphan-label
 cui/uiconfig/ui/aboutdialog.ui://GtkLabel[@id='copyright'] orphan-label


More information about the Libreoffice-commits mailing list