diff options
author | Eike Rathke <erack@redhat.com> | 2013-12-18 18:08:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-12-18 18:10:08 +0100 |
commit | cc54c08a66046c00af3713fbe5e69995ccb7f73b (patch) | |
tree | f9d3498f427d315013868b7964645cbc36fdb4a5 /i18nlangtag/source/languagetag/languagetag.cxx | |
parent | fab34eb54fffaaf1fc32a0901436d8940f6c8b43 (diff) |
resolved fdo#72778 keep setting system locale and LanguageTag in sync
Change-Id: I3547786bf77b8f611bc08d0e52c66ac00e199f13
Diffstat (limited to 'i18nlangtag/source/languagetag/languagetag.cxx')
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 68ee64c6208e..695343e5824c 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -364,7 +364,6 @@ private: /** Convert Locale to BCP 47 string without resolving system and creating temporary LanguageTag instances. */ static OUString convertToBcp47( const com::sun::star::lang::Locale& rLocale ); - }; @@ -713,6 +712,24 @@ LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( LanguageType nRegisterID return pImpl; } +// static +void LanguageTag::setConfiguredSystemLanguage( LanguageType nLang ) +{ + if (nLang == LANGUAGE_DONTKNOW || nLang == LANGUAGE_SYSTEM) + { + SAL_WARN( "i18nlangtag", + "LanguageTag::setConfiguredSystemLanguage: refusing to set unresolved system locale 0x" << + ::std::hex << nLang); + return; + } + SAL_INFO( "i18nlangtag", "LanguageTag::setConfiguredSystemLanguage: setting to 0x" << ::std::hex << nLang); + MsLangId::LanguageTagAccess::setConfiguredSystemLanguage( nLang); + // Resest system locale to none and let registerImpl() do the rest to + // initialize a new one. + theSystemLocale::get().reset(); + LanguageTag aLanguageTag( LANGUAGE_SYSTEM); + aLanguageTag.registerImpl(); +} static bool lcl_isKnownOnTheFlyID( LanguageType nLang ) { |