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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 5a56438..648073c 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 9ea511c..9885cde 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 2d279b1..ac27461 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 827ff31..4659794 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