From 39bf2eb9aa9d6d8db7e3204bf7afcb75a14c6f51 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 14 May 2018 06:27:36 -0400 Subject: [PATCH] [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"). --- src/modules/welcome/WelcomePage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 16e44d72e..0a1d2fb7d 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -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)" );