From 466e08a8baad120e4aa285770a0c71155c0d9ac7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 3 Sep 2020 20:33:22 +0200 Subject: [PATCH] [welcome] Set some localeConf values from the welcome page --- CHANGES | 5 +++++ src/modules/welcome/Config.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7508354c9..c44b3b84a 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,11 @@ on functionality, but do touch each and every source file: - *keyboardq* and *localeq* improvements. (Thanks to Anke) - *users* module did not set up autologin properly. This is yet another regression left over from 3.2.28. (Reported by Phil and pcrepix, #1498) + - *welcome* module now sets the *LANG* key in the locale configuration + (which is shared with the *locale* module and consumed by the + *localecfg* module). This makes it feasible to drop the *locale* + module and still set the installed system's language to the language + selected in Calamares. (Reported by FerenOS) # 3.2.29 (2020-08-20) # diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index d4641562a..72e1cfc3b 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -10,8 +10,11 @@ #include "Config.h" #include "Branding.h" +#include "GlobalStorage.h" +#include "JobQueue.h" #include "Settings.h" #include "geoip/Handler.h" +#include "locale/Global.h" #include "locale/Lookup.h" #include "modulesystem/ModuleManager.h" #include "utils/Logger.h" @@ -186,7 +189,12 @@ Config::setLocaleIndex( int index ) QLocale::setDefault( selectedLocale ); CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory() ); - + if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() ) + { + CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(), + QStringLiteral( "LANG" ), + CalamaresUtils::translatorLocaleName() ); + } emit localeIndexChanged( m_localeIndex ); }