i18n: fix typo and code-style

main
Adriaan de Groot 4 years ago
parent 53fb16437f
commit a1fb83bdc4

@ -24,7 +24,8 @@
* *
* Returns a pair of nullptrs for non-special cases. * Returns a pair of nullptrs for non-special cases.
*/ */
static std::pair< QLocale*, QString* > specialCase( const QString& localeName ) static std::pair< QLocale*, QString* >
specialCase( const QString& localeName )
{ {
if ( localeName == "sr@latin" ) if ( localeName == "sr@latin" )
{ {
@ -33,7 +34,7 @@ static std::pair< QLocale*, QString* > specialCase( const QString& localeName )
} }
if ( localeName == "ca@valencia" ) if ( localeName == "ca@valencia" )
{ {
static QString name = QStringLiteral( "Català (Valencia)" ); static QString name = QStringLiteral( "Català (València)" );
return { nullptr, &name }; return { nullptr, &name };
} }
@ -69,10 +70,10 @@ Label::Label( const QString& locale, LabelFormat format, QObject* parent )
bool needsCountryName = ( format == LabelFormat::AlwaysWithCountry ) bool needsCountryName = ( format == LabelFormat::AlwaysWithCountry )
|| ( locale.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 1 ); || ( locale.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 1 );
QString countryName = QString countryName = ( needsCountryName ?
( needsCountryName ?
m_locale.nativeCountryName() : QString() ); m_locale.nativeCountryName()
: QString() );
m_label = needsCountryName ? longFormat.arg( languageName, countryName ) : languageName; m_label = needsCountryName ? longFormat.arg( languageName, countryName ) : languageName;
m_englishLabel = needsCountryName ? longFormat.arg( englishName, QLocale::countryToString( m_locale.country() ) ) m_englishLabel = needsCountryName ? longFormat.arg( englishName, QLocale::countryToString( m_locale.country() ) )
: englishName; : englishName;

Loading…
Cancel
Save