summaryrefslogtreecommitdiff
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-08-29 20:51:45 +0200
committerEike Rathke <erack@redhat.com>2013-08-29 20:54:23 +0200
commite57a73cc6bedcb8f176e1804792a7ea1fd88796b (patch)
tree819498cd637f0167f1edf4a950f0dfa736ad39a2 /i18nlangtag
parent83d6ce0b1eb6229a518d79a1064a75956a0380f1 (diff)
convertLanguageToLocale: last resort en-US if resolve requested
Change-Id: I8ebdfe34765292f14642ec8c2721621e5638a17a
Diffstat (limited to 'i18nlangtag')
-rw-r--r--i18nlangtag/source/isolang/mslangid.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/i18nlangtag/source/isolang/mslangid.cxx b/i18nlangtag/source/isolang/mslangid.cxx
index 6e816ee3dde7..8f398e52d241 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -153,9 +153,17 @@ LanguageType MsLangId::resolveSystemLanguageByScriptType( LanguageType nLang, sa
{
// Still resolve LANGUAGE_DONTKNOW if resolving is not requested,
// but not LANGUAGE_SYSTEM or others.
+ LanguageType nOrigLang = nLang;
if (bResolveSystem || nLang == LANGUAGE_DONTKNOW)
nLang = MsLangId::getRealLanguage( nLang);
convertLanguageToLocaleImpl( nLang, aLocale);
+ if (bResolveSystem && aLocale.Language.isEmpty() && simplifySystemLanguages( nOrigLang) == LANGUAGE_SYSTEM)
+ {
+ // None found but resolve requested, last resort is "en-US".
+ aLocale.Language = "en";
+ aLocale.Country = "US";
+ aLocale.Variant = OUString();
+ }
}
return aLocale;
}