summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-28 10:26:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-09-28 11:39:00 +0100
commit219aae1cea7ba88d5a4503f8070566755efd3aef (patch)
tree5220ac449756a14d31edeb81118a62e88d604dae /cui
parent0145d83cc7872bf943de12e386645a7aa8868f5d (diff)
Resolves: tdf#96748 'Default Language' show current ui lang not new default
i.e. if you select it, then the General::UILocale is unset and a new default generated based on the L10N::UILocale and what langpacks are installed but what the entry string claims is "Default - Current Language", rather than "Default - The Language That Will Be Used", so split out the language selection code into a reusable bit and use that to get the name of the language which will be selected if this entry is used Change-Id: I13d901c9a47ef213aea86417501114d4231efae5
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optgdlg.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 4c59db28ebe3..fcbe8c9ce338 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -69,6 +69,7 @@
#include <unotools/searchopt.hxx>
#include <sal/macros.h>
#include <officecfg/Office/Common.hxx>
+#include <officecfg/Setup.hxx>
#include <comphelper/configuration.hxx>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -1103,6 +1104,16 @@ static OUString lcl_getDatePatternsConfigString( const LocaleDataWrapper& rLocal
return aBuf.makeStringAndClear();
}
+namespace
+{
+ //what ui language will be selected by default if the user override of General::UILocale is unset ?
+ LanguageTag GetInstalledLocaleForSystemUILanguage()
+ {
+ css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
+ return LanguageTag(getInstalledLocaleForSystemUILanguage(inst)).makeFallback();
+ }
+}
+
OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent,"OptLanguagesPage","cui/ui/optlanguagespage.ui", &rSet)
, pLangConfig(new LanguageConfig_Impl)
@@ -1137,7 +1148,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
OUString aUILang = m_sSystemDefaultString +
" - " +
- SvtLanguageTable::GetLanguageString( Application::GetSettings().GetUILanguageTag().getLanguageType(), true );
+ SvtLanguageTable::GetLanguageString(GetInstalledLocaleForSystemUILanguage().getLanguageType(), true);
m_pUserInterfaceLB->InsertEntry(aUILang);
m_pUserInterfaceLB->SetEntryData(0, nullptr);