Fix locale names and user-visible locale names.

This commit is contained in:
Teo Mrnjavac 2016-08-10 16:10:06 +02:00
parent 2b26f6e6c9
commit e6cabe277b
2 changed files with 15 additions and 5 deletions

View file

@ -368,7 +368,13 @@ LocalePage::init( const QString& initialRegion,
++it;
}
// We strip " UTF-8" from "en_US.UTF-8 UTF-8" because it's redundant redundant.
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); ++it )
{
if ( it->endsWith( " UTF-8" ) )
it->chop( 6 );
*it = it->simplified();
}
}
@ -448,7 +454,11 @@ LocalePage::prettyLCLocale( const QString& lcLocale )
QString localeString = lcLocale;
if ( localeString.endsWith( " UTF-8" ) )
localeString.remove( " UTF-8" );
return localeString;
QLocale locale( localeString );
//: Language (Country)
return tr( "%1 (%2)" ).arg( QLocale::languageToString( locale.language() ) )
.arg( QLocale::countryToString( locale.country() ) );
}
void