Kaydet (Commit) 396d29d9 authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 9fb7c77e
......@@ -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;
}
......
......@@ -52,6 +52,7 @@ private:
OUString m_aCreditsLinkStr;
OUString m_sBuildStr;
OUString m_aLocaleStr;
OUString m_aUILocaleStr;
OUString m_buildIdLinkString;
void SetBuildIdLink();
......
<?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>
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment