mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[locale] Refactor to make updating global locale setting easier.
This commit is contained in:
parent
e52f0318fe
commit
3ff480eaa9
2 changed files with 17 additions and 2 deletions
|
@ -481,6 +481,16 @@ LocalePage::prettyLCLocale( const QString& lcLocale ) const
|
|||
.arg( QLocale::countryToString( locale.country() ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LocalePage::updateGlobalLocale()
|
||||
{
|
||||
auto *gs = Calamares::JobQueue::instance()->globalStorage();
|
||||
const QString bcp47 = m_selectedLocaleConfiguration.toBcp47();
|
||||
gs->insert( "locale", bcp47 );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LocalePage::updateGlobalStorage()
|
||||
{
|
||||
|
@ -493,8 +503,7 @@ LocalePage::updateGlobalStorage()
|
|||
gs->insert( "locationRegion", location.region );
|
||||
gs->insert( "locationZone", location.zone );
|
||||
|
||||
const QString bcp47 = m_selectedLocaleConfiguration.toBcp47();
|
||||
gs->insert( "locale", bcp47 );
|
||||
updateGlobalLocale();
|
||||
|
||||
// If we're in chroot mode (normal install mode), then we immediately set the
|
||||
// timezone on the live system. When debugging timezones, don't bother.
|
||||
|
|
|
@ -57,6 +57,12 @@ private:
|
|||
// the settings for language and numbers.
|
||||
std::pair< QString, QString > prettyLocaleStatus( const LocaleConfiguration& ) const;
|
||||
|
||||
/** @brief Update the GS *locale* key with the selected system language.
|
||||
*
|
||||
* This uses whatever is set in m_selectedLocaleConfiguration as the language,
|
||||
* and writes it to GS *locale* key (as a string, in BCP47 format).
|
||||
*/
|
||||
void updateGlobalLocale();
|
||||
void updateGlobalStorage();
|
||||
void updateLocaleLabels();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue