diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-08 11:24:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-08 15:40:59 +0100 |
commit | 396d29d9deccef6fa4ecf9ea8aa6a5d6f6065c53 (patch) | |
tree | 6650841a2d301ab35e630071c445bfa34e6e0fe2 /cui | |
parent | 9fb7c77e5cfc5add880aee18e36a851b8929137a (diff) |
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>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/about.cxx | 23 | ||||
-rw-r--r-- | cui/source/inc/about.hxx | 1 | ||||
-rw-r--r-- | cui/uiconfig/ui/aboutdialog.ui | 15 |
3 files changed, 29 insertions, 10 deletions
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> |