diff options
-rw-r--r-- | desktop/source/app/langselect.cxx | 15 | ||||
-rw-r--r-- | svx/source/dialog/langbox.cxx | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 2958ed8786b5..8a07e26c3134 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -121,11 +121,18 @@ bool prepareLocale() { } MsLangId::setConfiguredSystemUILanguage(tag.getLanguageType(false)); + // Note the system language/locale here may or may not be correct before we + // actually set it below. It is what could be figured from the system + // setting and may only partially match, like "en" for an unsupported + // English locale. + LanguageTag aSysLocTag( MsLangId::getSystemLanguage()); OUString setupSysLoc(officecfg::Setup::L10N::ooSetupSystemLocale::get()); - LanguageTag::setConfiguredSystemLanguage( - setupSysLoc.isEmpty() - ? MsLangId::getSystemLanguage() - : LanguageTag(setupSysLoc).getLanguageType(false)); + if (!setupSysLoc.isEmpty()) + aSysLocTag.reset( setupSysLoc); + // Ensure the system locale is set to a known supported locale. + aSysLocTag.makeFallback(); + LanguageTag::setConfiguredSystemLanguage( aSysLocTag.getLanguageType(false)); + // #i32939# setting of default document locale // #i32939# this should not be based on the UI language // So obtain the system locale now configured just above and pass it on, diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index fcd9c54e3774..ca9344f32bc7 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -356,6 +356,8 @@ weld::ComboBoxEntry SvxLanguageBox::BuildEntry(const LanguageType nLangType, sal else if (nRealLang == LANGUAGE_USER_SYSTEM_CONFIG) { nRealLang = MsLangId::getSystemLanguage(); + // Whatever we obtained, ensure a known supported locale. + nRealLang = LanguageTag(nRealLang).makeFallback().getLanguageType(); aStrEntry += " - " + SvtLanguageTable::GetLanguageString( nRealLang ); } |