mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Partially revert fb7ba92f6
and split the Chinese locales into 3.
Chinese Simplified, Chinese Traditional(Taiwan), Chinese Traditional(Hong Kong). Closes #3262.
This commit is contained in:
parent
6dd3795b7a
commit
61705fdd42
9 changed files with 6537 additions and 38 deletions
|
@ -1077,19 +1077,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 ) {
|
||||
|
@ -1374,9 +1362,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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue