[libcalamares] English label with country

This commit is contained in:
Adriaan de Groot 2019-04-19 13:52:19 +02:00
parent 81acc496dc
commit cb5825a521

View File

@ -26,7 +26,7 @@ LocaleLabel::LocaleLabel()
: m_locale( QLocale() ) : m_locale( QLocale() )
{ {
m_localeId = m_locale.name(); m_localeId = m_locale.name();
setLabels( QString(), LabelFormat::IfNeededWithCountry ); setLabels( QString(), LabelFormat::IfNeededWithCountry );
} }
@ -55,8 +55,8 @@ LocaleLabel::setLabels( const QString& locale, LabelFormat format )
if ( needsCountryName ) if ( needsCountryName )
countryName = m_locale.nativeCountryName(); countryName = m_locale.nativeCountryName();
m_label = needsCountryName ? longFormat.arg( languageName ).arg( countryName ) : languageName; m_label = needsCountryName ? longFormat.arg( languageName, countryName ) : languageName;
m_englishLabel = englishName; m_englishLabel = needsCountryName ? longFormat.arg( englishName, QLocale::countryToString( m_locale.country() ) ) : englishName;
} }
QLocale LocaleLabel::getLocale( const QString& localeName ) QLocale LocaleLabel::getLocale( const QString& localeName )