diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 1adc8af2ee65..86ba25793828 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -107,9 +107,8 @@ namespace desktop " or socket,host=localhost,port=54321;urp \n" " --unaccept={connect-string} Closes an acceptor that was created with \n" " --accept. Use --unaccept=all to close all acceptors. \n" - " --language={lang} Uses specified language, if language is not selected \n" - " yet for UI. The lang is a tag of the language in IETF \n" - " language tag. \n\n" + " --language={lang} Overrides the choice of language for the UI. The lang is\n" + " a tag of the language in IETF language tag. \n\n" "Developer arguments: \n" " --terminate_after_init \n" " Exit after initialization complete (no documents loaded)\n" diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 702f0a66f224..4babad8075a3 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -77,26 +77,26 @@ bool prepareLocale() { setMsLangIdFallback(officecfg::System::L10N::Locale::get()); css::uno::Sequence inst( officecfg::Setup::Office::InstalledLocales::get()->getElementNames()); - OUString locale(officecfg::Office::Linguistic::General::UILocale::get()); - if (!locale.isEmpty()) { - locale = getInstalledLocaleForLanguage(inst, locale); - if (locale.isEmpty()) { - // Selected language is not/no longer installed: - try { - std::shared_ptr batch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Linguistic::General::UILocale::set( - u""_ustr, batch); - batch->commit(); - } catch (const css::uno::Exception &) { - TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); + OUString locale = getInstalledLocaleForLanguage( + inst, Desktop::GetCommandLineArgs().GetLanguage()); + if (locale.isEmpty()) { + locale = officecfg::Office::Linguistic::General::UILocale::get(); + if (!locale.isEmpty()) { + locale = getInstalledLocaleForLanguage(inst, locale); + if (locale.isEmpty()) { + // Selected language is not/no longer installed: + try { + std::shared_ptr batch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Linguistic::General::UILocale::set( + u""_ustr, batch); + batch->commit(); + } catch (const css::uno::Exception &) { + TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); + } } } } - if (locale.isEmpty()) { - locale = getInstalledLocaleForLanguage( - inst, Desktop::GetCommandLineArgs().GetLanguage()); - } if (locale.isEmpty()) { locale = getInstalledLocaleForSystemUILanguage(inst, true); }