summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-04-28 13:18:50 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-04-30 08:22:18 +0000
commite45f01a28eab1db7ef05224a8fb89a438f93c22e (patch)
treeb99de8b02361d7398147317b756f4fc97b399cc4
parente8777783db81279a6b0e9cc7b308f10719bd8a7b (diff)
don't assume Country to be always present, tdf#85432 follow-up
For example, 'C' was displayed as "C_" Also, append Variant if present to display the full locale identifier, for example "en_US.UTF-8" Change-Id: I00c7bf832df25c00cc014589c4662806f8bf1137 (cherry picked from commit f318e305b6afa715ef759b8589823da53b812a88) Reviewed-on: https://gerrit.libreoffice.org/15557 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/about.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index b9e3306e2048..2c39df8e2c1d 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -240,9 +240,14 @@ OUString AboutDialog::GetLocaleString()
osl_getProcessLocale( &pLocale );
- if ( pLocale && pLocale->Language && pLocale->Country )
+ if ( pLocale && pLocale->Language )
{
- pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+ if (pLocale->Country && rtl_uString_getLength( pLocale->Country) > 0)
+ pLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
+ else
+ pLocaleStr = OUString(pLocale->Language);
+ if (pLocale->Variant && rtl_uString_getLength( pLocale->Variant) > 0)
+ pLocaleStr += OUString(pLocale->Variant);
}
return pLocaleStr;