[locale] Update language always

onActivate of locale updates the language only when currentLocation changed
or when onActivate of locale is called for the first time.
However, It is irrelevant solution since the language is set by the welcome.
So language should be updated always.
The language is used by keyboard module to guessing a layout of keyboard.
Once you face the locale, you can't change language in the welcome
if you don't change the timezone.
This commit is contained in:
tjpark88 2021-12-30 17:40:26 +09:00 committed by Adriaan de Groot
parent 2aaaabe152
commit 79a91b486a

View File

@ -252,15 +252,21 @@ Config::setCurrentLocation( const QString& regionName, const QString& zoneName )
void
Config::setCurrentLocation( const CalamaresUtils::Locale::TimeZoneData* location )
{
if ( location != m_currentLocation )
bool updateLocation = ( location != m_currentLocation );
if ( updateLocation )
{
m_currentLocation = location;
// Overwrite those settings that have not been made explicit.
auto newLocale = automaticLocaleConfiguration();
if ( !m_selectedLocaleConfiguration.explicit_lang )
{
setLanguage( newLocale.language() );
}
}
// Always lang should be updated
auto newLocale = automaticLocaleConfiguration();
if ( !m_selectedLocaleConfiguration.explicit_lang )
{
setLanguage( newLocale.language() );
}
if ( updateLocation )
{
if ( !m_selectedLocaleConfiguration.explicit_lc )
{
m_selectedLocaleConfiguration.lc_numeric = newLocale.lc_numeric;