summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/about.cxx
diff options
context:
space:
mode:
authorBrij Mohan Lal Srivastava <contactbrijmohan@gmail.com>2014-11-16 01:58:54 +0530
committerMichael Meeks <michael.meeks@collabora.com>2014-11-16 08:35:38 +0000
commitc5092a8d0edeada83118c595b61ee80486e84659 (patch)
tree40a12f19fa85175c22bf0899250d3ef1326ba5c1 /cui/source/dialogs/about.cxx
parent1defd9aeb9c051dc3b719bade5edb58462b4b817 (diff)
fdo#85432 : Add locale details to help->about
Added locale text to About dialog Change-Id: Ic26219e8fe845b4c5027b65d5f5edba9279b1b11 Reviewed-on: https://gerrit.libreoffice.org/12464 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'cui/source/dialogs/about.cxx')
-rw-r--r--cui/source/dialogs/about.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 0846bd369959..b9e3306e2048 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -77,6 +77,7 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
m_aVersionTextStr = m_pVersion->GetText();
m_aBasedTextStr = get<FixedText>("libreoffice")->GetText();
m_aBasedDerivedTextStr = get<FixedText>("derived")->GetText();
+ m_pLocaleStr = get<FixedText>("locale")->GetText();;
m_pVersion->SetText(GetVersionString());
@@ -232,12 +233,29 @@ OUString AboutDialog::GetBuildId()
return sBuildId;
}
+OUString AboutDialog::GetLocaleString()
+{
+ OUString pLocaleStr;
+ rtl_Locale * pLocale;
+
+ osl_getProcessLocale( &pLocale );
+
+ if ( pLocale && pLocale->Language && pLocale->Country )
+ {
+ pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+ }
+
+ return pLocaleStr;
+}
+
OUString AboutDialog::GetVersionString()
{
OUString sVersion = m_aVersionTextStr;
OUString sBuildId = GetBuildId();
+ OUString pLocaleStr = GetLocaleString();
+
if (!sBuildId.trim().isEmpty())
{
sVersion += "\n";
@@ -255,6 +273,17 @@ OUString AboutDialog::GetVersionString()
sVersion += EXTRA_BUILDID;
}
+ if (!pLocaleStr.trim().isEmpty())
+ {
+ sVersion += "\n";
+ if (m_pLocaleStr.indexOf("$LOCALE") == -1)
+ {
+ SAL_WARN( "cui.dialogs", "translated locale string in translations doesn't contain $LOCALE placeholder" );
+ m_pLocaleStr += " $LOCALE";
+ }
+ sVersion += m_pLocaleStr.replaceAll("$LOCALE", pLocaleStr);
+ }
+
return sVersion;
}