Skip to content

Commit

Permalink
Show simplified & traditional chinese properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
hatstand committed Jan 8, 2015
1 parent 08449c7 commit 66ac5fa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ui/behavioursettingspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog* dialog)
// The regex captures the "ru" from "clementine_ru.qm"
if (!lang_re.exactMatch(filename)) continue;

QString code = lang_re.cap(1).replace("@latin", "_Latn");
QString language_name = QLocale::languageToString(QLocale(code).language());
QString code = lang_re.cap(1);
QString lookup_code = QString(code)
.replace("@latin", "_Latn")
.replace("_CN", "_Hans_CN")
.replace("_TW", "_Hant_TW");
QString language_name =
QLocale::languageToString(QLocale(lookup_code).language());
#if QT_VERSION >= 0x040800
QString native_name = QLocale(code).nativeLanguageName();
QString native_name = QLocale(lookup_code).nativeLanguageName();
if (!native_name.isEmpty()) {
language_name = native_name;
}
Expand Down

0 comments on commit 66ac5fa

Please sign in to comment.