diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-12 07:45:22 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-15 09:26:00 +0100 |
commit | cbcec4425e04e3614a2025b49fdc221216ac51d3 (patch) | |
tree | ddc330ec8888202dd2f0a6dbf85da3d12cb6b99c /desktop/source/app/langselect.cxx | |
parent | 737112d7c37300661972778a63a4e93fa196a395 (diff) |
tdf#121245: also set ooLocale when language is set by command line
ooLocale is re-written in each invocation of langselect::prepareLocale
from Desktop::Init; previously an exception was when it was set by command
line. This special treatment was from initial '--language' implementation
in commit d47dd2bf33b0a2a9a5251a871bb7fe0573724274.
The problem here is this setting is the fallback for multiple code paths,
so many UI elements got language from old ooLocale data in that case.
This setting is re-written every time the program is started, so it should
be no harm in writing it also in command line case.
Alternatively we could try to fix all places to use configured system UI
language from MsLangId instead, or to create a backend layer for ooLocale
that itself uses that.
Change-Id: Idf7212901620bc158f704ba21747294634e48ae1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110776
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop/source/app/langselect.cxx')
-rw-r--r-- | desktop/source/app/langselect.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 711d567d2063..2958ed8786b5 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -93,13 +93,9 @@ bool prepareLocale() { } } } - bool cmdLanguage = false; if (locale.isEmpty()) { locale = getInstalledLocaleForLanguage( inst, Desktop::GetCommandLineArgs().GetLanguage()); - if (!locale.isEmpty()) { - cmdLanguage = true; - } } if (locale.isEmpty()) { locale = getInstalledLocaleForSystemUILanguage(inst, true); @@ -115,15 +111,13 @@ bool prepareLocale() { css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext()), css::uno::UNO_QUERY_THROW)->setLocale(tag.getLocale(false)); - if (!cmdLanguage) { - try { - std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create()); - officecfg::Setup::L10N::ooLocale::set(locale, batch); - batch->commit(); - } catch (const css::uno::Exception &) { - TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); - } + try { + std::shared_ptr<comphelper::ConfigurationChanges> batch( + comphelper::ConfigurationChanges::create()); + officecfg::Setup::L10N::ooLocale::set(locale, batch); + batch->commit(); + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); } MsLangId::setConfiguredSystemUILanguage(tag.getLanguageType(false)); |