i18n: fix typo and code-style

This commit is contained in:
Adriaan de Groot 2021-07-26 11:16:26 +02:00
parent 53fb16437f
commit a1fb83bdc4

View File

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