[locale] Defer to the locale-service idea of LANG
- Using QLocale().name() loses some special locales that Calamares understands but Qt does not (e.g. sr@latn, ca@valencia) so do it in two steps.
This commit is contained in:
parent
2478570deb
commit
79db04dc2e
@ -305,8 +305,14 @@ Config::automaticLocaleConfiguration() const
|
||||
{
|
||||
return LocaleConfiguration();
|
||||
}
|
||||
return LocaleConfiguration::fromLanguageAndLocation(
|
||||
QLocale().name(), supportedLocales(), currentLocation()->country() );
|
||||
|
||||
auto* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||
QString lang = CalamaresUtils::Locale::readGS( *gs, QStringLiteral( "LANG" ) );
|
||||
if ( lang.isEmpty() )
|
||||
{
|
||||
lang = QLocale().name();
|
||||
}
|
||||
return LocaleConfiguration::fromLanguageAndLocation( lang, supportedLocales(), currentLocation()->country() );
|
||||
}
|
||||
|
||||
LocaleConfiguration
|
||||
|
Loading…
Reference in New Issue
Block a user