diff --git a/src/modules/locale/LocaleConfiguration.cpp b/src/modules/locale/LocaleConfiguration.cpp
index 3631befec..b8f5f6a9e 100644
--- a/src/modules/locale/LocaleConfiguration.cpp
+++ b/src/modules/locale/LocaleConfiguration.cpp
@@ -272,7 +272,7 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
bool
-LocaleConfiguration::isEmpty()
+LocaleConfiguration::isEmpty() const
{
return lang.isEmpty() &&
lc_numeric.isEmpty() &&
diff --git a/src/modules/locale/LocaleConfiguration.h b/src/modules/locale/LocaleConfiguration.h
index a93ddffac..073d19a5b 100644
--- a/src/modules/locale/LocaleConfiguration.h
+++ b/src/modules/locale/LocaleConfiguration.h
@@ -33,7 +33,7 @@ public:
const QStringList& availableLocales,
const QString& countryCode );
- bool isEmpty();
+ bool isEmpty() const;
// These become all uppercase in locale.conf, but we keep them lowercase here to
// avoid confusion with locale.h.
diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp
index c950b415c..4882b1684 100644
--- a/src/modules/locale/LocalePage.cpp
+++ b/src/modules/locale/LocalePage.cpp
@@ -233,11 +233,9 @@ LocalePage::updateLocaleLabels()
LocaleConfiguration lc = m_selectedLocaleConfiguration.isEmpty() ?
guessLocaleConfiguration() :
m_selectedLocaleConfiguration;
- m_localeLabel->setText( tr( "The system language will be set to %1." )
- .arg( prettyLCLocale( lc.lang ) ) );
-
- m_formatsLabel->setText( tr( "The numbers and dates locale will be set to %1." )
- .arg( prettyLCLocale( lc.lc_numeric ) ) );
+ auto labels = prettyLocaleStatus( lc );
+ m_localeLabel->setText( labels.first );
+ m_formatsLabel->setText( labels.second );
}
@@ -383,6 +381,15 @@ LocalePage::init( const QString& initialRegion,
updateGlobalStorage();
}
+std::pair< QString, QString > LocalePage::prettyLocaleStatus( const LocaleConfiguration& lc ) const
+{
+ return std::make_pair< QString, QString >(
+ tr( "The system language will be set to %1." )
+ .arg( prettyLCLocale( lc.lang ) ),
+ tr( "The numbers and dates locale will be set to %1." )
+ .arg( prettyLCLocale( lc.lc_numeric ) )
+ );
+}
QString
LocalePage::prettyStatus() const
@@ -392,6 +399,13 @@ LocalePage::prettyStatus() const
.arg( m_regionCombo->currentText() )
.arg( m_zoneCombo->currentText() );
+ LocaleConfiguration lc = m_selectedLocaleConfiguration.isEmpty() ?
+ guessLocaleConfiguration() :
+ m_selectedLocaleConfiguration;
+ auto labels = prettyLocaleStatus(lc);
+ status += labels.first + "
";
+ status += labels.second + "
";
+
return status;
}
@@ -433,7 +447,7 @@ LocalePage::onActivate()
LocaleConfiguration
-LocalePage::guessLocaleConfiguration()
+LocalePage::guessLocaleConfiguration() const
{
QLocale myLocale; // User-selected language
@@ -455,7 +469,7 @@ LocalePage::guessLocaleConfiguration()
QString
-LocalePage::prettyLCLocale( const QString& lcLocale )
+LocalePage::prettyLCLocale( const QString& lcLocale ) const
{
QString localeString = lcLocale;
if ( localeString.endsWith( " UTF-8" ) )
diff --git a/src/modules/locale/LocalePage.h b/src/modules/locale/LocalePage.h
index 3615016e5..27a7362e3 100644
--- a/src/modules/locale/LocalePage.h
+++ b/src/modules/locale/LocalePage.h
@@ -50,8 +50,13 @@ public:
void onActivate();
private:
- LocaleConfiguration guessLocaleConfiguration();
- QString prettyLCLocale( const QString& localesMap );
+ LocaleConfiguration guessLocaleConfiguration() const;
+ QString prettyLCLocale( const QString& localesMap ) const;
+
+ // For the given locale config, return two strings describing
+ // the settings for language and numbers.
+ std::pair< QString, QString > prettyLocaleStatus( const LocaleConfiguration& ) const;
+
void updateGlobalStorage();
void updateLocaleLabels();