diff --git a/CMakeLists.txt b/CMakeLists.txt index 27fcda865..99ee4330e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,9 +138,9 @@ set( _tx_complete az az_AZ ca de fi_FI he hi hr ja ko lt pt_BR sq set( _tx_good as be ca@valencia cs_CZ da fr fur it_IT ml nl pt_PT ru sk tg tr_TR vi zh_CN ) set( _tx_ok ar ast bg bn el en_GB es es_MX es_PR et eu fa gl hu id - is mr nb pl ro si sl sr sr@latin th zh_HK ) + is mr nb pl ro si sl sr sr@latin th ) set( _tx_incomplete eo es_PE fr_CH gu id_ID ie kk kn ko_KR lo lv mk - ne ne_NP ru_RU te ur uz zh ) + ne ne_NP ru_RU te ur uz ) ### Required versions # diff --git a/src/libcalamares/locale/Translation.cpp b/src/libcalamares/locale/Translation.cpp index fb8890e87..d439f51b7 100644 --- a/src/libcalamares/locale/Translation.cpp +++ b/src/libcalamares/locale/Translation.cpp @@ -38,6 +38,18 @@ specialCase( const CalamaresUtils::Locale::Translation::Id& locale ) static QString name = QStringLiteral( "Català (València)" ); return { nullptr, &name }; } + if ( localeName == "zh_CN" ) + { + // Simplified Chinese, but drop the (China) from the name + static QString name = QStringLiteral( "简体中文" ); + return { nullptr, &name }; + } + if ( localeName == "zh_TW" ) + { + // Traditional Chinese, but drop (Taiwan) from the name + static QString name = QStringLiteral( "繁體中文" ); + return { nullptr, &name }; + } return { nullptr, nullptr }; } @@ -70,11 +82,9 @@ Translation::Translation( const Id& localeId, LabelFormat format, QObject* paren } bool needsCountryName = ( format == LabelFormat::AlwaysWithCountry ) - || ( localeId.name.contains( '_' ) && QLocale::countriesForLanguage( m_locale.language() ).count() > 1 ); - QString countryName = ( needsCountryName ? - - m_locale.nativeCountryName() - : QString() ); + || ( !name && localeId.name.contains( '_' ) + && QLocale::countriesForLanguage( m_locale.language() ).count() > 1 ); + QString countryName = needsCountryName ? m_locale.nativeCountryName() : QString(); m_label = needsCountryName ? longFormat.arg( languageName, countryName ) : languageName; m_englishLabel = needsCountryName ? longFormat.arg( englishName, QLocale::countryToString( m_locale.country() ) ) : englishName;