Partially revert fec6c8af2 and split the Chinese locales into 3.

Chinese Simplified, Chinese Traditional(Taiwan), Chinese Traditional(Hong Kong).
Closes #3262.
This commit is contained in:
sledgehammer999
2015-07-04 01:34:06 +03:00
parent 41e052498b
commit 74bba9ecfe
9 changed files with 6989 additions and 605 deletions

View File

@@ -1078,19 +1078,7 @@ QString options_imp::getLocale() const {
void options_imp::setLocale(const QString &localeStr) {
QLocale locale(localeStr);
QString name;
// Check if Chinese and act according to script instead of country
if (locale.language() == QLocale::Chinese) {
if (locale.script() == QLocale::SimplifiedHanScript)
name = "zh_Hans";
else
name = "zh_Hant";
}
else {
name = locale.name();
}
QString name = locale.name();
// Attempt to find exact match
int index = comboI18n->findData(name, Qt::UserRole);
if (index < 0 ) {
@@ -1375,9 +1363,15 @@ QString options_imp::languageToLocalizedString(const QLocale &locale)
case QLocale::Basque: return QString::fromUtf8(C_LOCALE_BASQUE);
case QLocale::Vietnamese: return QString::fromUtf8(C_LOCALE_VIETNAMESE);
case QLocale::Chinese: {
if (locale.script() == QLocale::SimplifiedHanScript)
return QString::fromUtf8(C_LOCALE_CHINESE_SIMPLIFIED);
return QString::fromUtf8(C_LOCALE_CHINESE_TRADITIONAL);
switch(locale.country()) {
case QLocale::China:
return QString::fromUtf8(C_LOCALE_CHINESE_SIMPLIFIED);
case QLocale::HongKong:
return QString::fromUtf8(C_LOCALE_CHINESE_TRADITIONAL_HK);
default:
return QString::fromUtf8(C_LOCALE_CHINESE_TRADITIONAL_TW);
}
}
case QLocale::Korean: return QString::fromUtf8(C_LOCALE_KOREAN);
default: {