[welcome] Fix display of unsupported locales

- Some locales have no nativeLanguageName(), so instead display
   the locale id (e.g. "eo") and the resulting language in English
   (which, if it is really unsupported, will be "C").
This commit is contained in:
Adriaan de Groot 2018-05-14 06:27:36 -04:00
parent b0e5e13221
commit 39bf2eb9aa

View File

@ -141,6 +141,9 @@ struct LocaleLabel
QString sortKey = QLocale::languageToString( m_locale.language() );
QString label = m_locale.nativeLanguageName();
if ( label.isEmpty() )
label = QString( QLatin1Literal( "* %1 (%2)" ) ).arg( locale, sortKey );
if ( locale.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 2 )
{
QLatin1Literal countrySuffix( " (%1)" );