Locale: when entering page, guess language.

If user picks an installer language on the welcome page, then
the system language follows that setting -- but only after the
first action where Calamares must guess the system language
based on location. So guess on entry, so that system language
follows installer language.

FIXES #688.
This commit is contained in:
Adriaan de Groot 2017-06-07 03:52:44 +06:00 committed by Philip
parent 49cdaf10d6
commit 9ad46eca55

View File

@ -419,6 +419,13 @@ void
LocalePage::onActivate() LocalePage::onActivate()
{ {
m_regionCombo->setFocus(); m_regionCombo->setFocus();
if ( m_selectedLocaleConfiguration.isEmpty() ||
!m_selectedLocaleConfiguration.explicit_lang )
{
auto newLocale = guessLocaleConfiguration();
m_selectedLocaleConfiguration.lang = newLocale.lang;
updateLocaleLabels();
}
} }