summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-02-19 00:27:04 +0100
committerEike Rathke <erack@redhat.com>2013-02-19 00:27:56 +0100
commit2c36a832b85eeff6b4a2f6c6aab599e4b10b8886 (patch)
treea551cf5a2052bf04b2cd8a940e469d6999e7720b /i18npool
parent08ac21ddd96bec9d3992e6411d4e9ba7826ceccd (diff)
for now convert using MsLangId::convertUnxByteStringToLanguage()
Change-Id: Iaedd4bd6eda1db293fa3dc6222c7353ce466ec04
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/languagetag/languagetag.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 84947354c229..2117771fdb67 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -260,24 +260,28 @@ LanguageTag::LanguageTag( const rtl_Locale & rLocale )
// looking for '.' dot delimiter or '@' modifier content.
if (!maLocale.Variant.isEmpty())
{
+ OString aStr = OUStringToOString( maLocale.Language + "_" + maLocale.Country + maLocale.Variant,
+ RTL_TEXTENCODING_UTF8);
/* FIXME: let liblangtag parse this entirely with
* lt_tag_convert_from_locale() but that needs a patch to pass the
* string. */
#if 0
- OString aStr = OUStringToOString( maLocale.Language + "-" + maLocale.Country + maLocale.Variant,
- RTL_TEXTENCODING_UTF8);
myLtError aError;
theDataRef::get().incRef();
mpImplLangtag = lt_tag_convert_from_locale( aStr.getStr(), &aError.p);
maBcp47 = OStringToOUString( lt_tag_get_string( MPLANGTAG), RTL_TEXTENCODING_UTF8);
mbInitializedBcp47 = true;
- maLocale = lang::Locale();
- mbInitializedLocale = false;
#else
- SAL_WARN( "i18npool.langtag", "rtl_Locale Variant modifier not handled");
- // For now clear anything unknown to us.
- maLocale.Variant = OUString();
+ mnLangID = MsLangId::convertUnxByteStringToLanguage( aStr);
+ if (mnLangID == LANGUAGE_DONTKNOW)
+ {
+ SAL_WARN( "i18npool.langtag", "LanguageTag(rtl_Locale) - unknown: " << aStr);
+ mnLangID = LANGUAGE_ENGLISH_US; // we need _something_ here
+ }
+ mbInitializedLangID = true;
#endif
+ maLocale = lang::Locale();
+ mbInitializedLocale = false;
}
}