summaryrefslogtreecommitdiff
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-08-23 20:05:09 +0200
committerEike Rathke <erack@redhat.com>2013-08-23 23:09:07 +0200
commitf3e124f4bd759095d977a9639d226ed582ed76d7 (patch)
treee21923776613b8da222abce306c654efcf9d6196 /i18nlangtag
parent22c19620dc44b8f619936c7dbd4b07c6a372d2de (diff)
moved privateuse handling to convertLanguageToLocaleImpl()
Change-Id: Id9cdd5734f54fd4fca43f5e0d928d9cb37e8f63f
Diffstat (limited to 'i18nlangtag')
-rw-r--r--i18nlangtag/source/isolang/isolang.cxx9
-rw-r--r--i18nlangtag/source/isolang/mslangid.cxx7
2 files changed, 7 insertions, 9 deletions
diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx
index 3edc5999b690..1e7ac848fc73 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -23,6 +23,7 @@
#include <rtl/strbuf.hxx>
#include "i18nlangtag/mslangid.hxx"
+#include "i18nlangtag/languagetag.hxx"
// =======================================================================
@@ -670,6 +671,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
{
rLocale.Language = OUString::createFromAscii( pEntry->maLangStr );
rLocale.Country = OUString::createFromAscii( pEntry->maCountry );
+ rLocale.Variant = OUString();
return;
}
++pEntry;
@@ -686,6 +688,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
{
rLocale.Language = OUString::createFromAscii( pNoneStdEntry->maLangStr );
rLocale.Country = OUString::createFromAscii( pNoneStdEntry->maCountry );
+ rLocale.Variant = OUString();
return;
}
++pNoneStdEntry;
@@ -698,17 +701,19 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
{
if ( pPrivateEntry->mnLang == nLang )
{
- rLocale.Language = OUString::createFromAscii( pPrivateEntry->mpLangStr );
+ rLocale.Language = I18NLANGTAG_QLT;
rLocale.Country = OUString();
+ rLocale.Variant = OUString::createFromAscii( pPrivateEntry->mpLangStr );
return;
}
++pPrivateEntry;
}
while ( pPrivateEntry->mnLang != LANGUAGE_DONTKNOW );
- // not found
+ // Not found. The effective result is the empty SYSTEM locale.
rLocale.Language = OUString();
rLocale.Country = OUString();
+ rLocale.Variant = OUString();
}
// -----------------------------------------------------------------------
diff --git a/i18nlangtag/source/isolang/mslangid.cxx b/i18nlangtag/source/isolang/mslangid.cxx
index c31fde12db0a..a4daef86af92 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -156,13 +156,6 @@ LanguageType MsLangId::resolveSystemLanguageByScriptType( LanguageType nLang, sa
if (bResolveSystem || nLang == LANGUAGE_DONTKNOW)
nLang = MsLangId::getRealLanguage( nLang);
convertLanguageToLocaleImpl( nLang, aLocale);
- /* FIXME: this x-... is temporary until conversion will be moved up to
- * LanguageTag. Also handle the nasty "*" joker as privateuse. */
- if (aLocale.Language.startsWith( "x-") || (aLocale.Language == "*"))
- {
- aLocale.Variant = aLocale.Language;
- aLocale.Language = "qlt";
- }
}
return aLocale;
}