diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-03 17:49:25 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-01-05 09:51:54 +0100 |
commit | 7ca3490d91a1fc4e01b34ea1a2f281968b0b1479 (patch) | |
tree | 04f48387cc631224db3fa3b7b3a2f6fe4afd6c06 /svtools | |
parent | 028fd03cdf4d3d8072289a5c4d476435c18f90d0 (diff) |
lokdialog: Use only one of the installed langpacks when setting locale.
Change-Id: I446775b121b7806a549f4dbbaa1f2dcf019d9bc2
Reviewed-on: https://gerrit.libreoffice.org/47386
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/langhelp.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx index e4e64375e4b5..5bbc01172964 100644 --- a/svtools/source/misc/langhelp.cxx +++ b/svtools/source/misc/langhelp.cxx @@ -102,9 +102,12 @@ public: } }; -OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence<OUString>& rLocaleElementNames, bool bRequestInstallIfMissing) +OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence<OUString>& rLocaleElementNames, bool bRequestInstallIfMissing, const OUString& rPreferredLocale) { - OUString wantedLocale = officecfg::System::L10N::UILocale::get(); + OUString wantedLocale(rPreferredLocale); + if (wantedLocale.isEmpty()) + wantedLocale = officecfg::System::L10N::UILocale::get(); + OUString locale = getInstalledLocaleForLanguage(rLocaleElementNames, wantedLocale); if (bRequestInstallIfMissing && locale.isEmpty() && !wantedLocale.isEmpty() && !Application::IsHeadlessModeEnabled() && officecfg::Office::Common::PackageKit::EnableLangpackInstallation::get()) |