mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-11 04:42:22 +00: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
@ -339,18 +339,7 @@ void Application::initializeTranslation()
|
||||
QString locale = pref->getLocale();
|
||||
|
||||
if (locale.isEmpty()) {
|
||||
QLocale systemLocale = QLocale::system();
|
||||
// Check if Chinese and act according to script instead of country
|
||||
if (systemLocale.language() == QLocale::Chinese) {
|
||||
if (systemLocale.script() == QLocale::SimplifiedHanScript)
|
||||
locale = "zh_Hans";
|
||||
else
|
||||
locale = "zh_Hant";
|
||||
}
|
||||
else {
|
||||
locale = systemLocale.name();
|
||||
}
|
||||
|
||||
locale = QLocale::system().name();
|
||||
pref->setLocale(locale);
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,7 @@ const char C_LOCALE_GEORGIAN[] = "ქართული";
|
||||
const char C_LOCALE_BYELORUSSIAN[] = "Беларуская";
|
||||
const char C_LOCALE_BASQUE[] = "Euskara";
|
||||
const char C_LOCALE_VIETNAMESE[] = "tiếng Việt";
|
||||
const char C_LOCALE_CHINESE_TRADITIONAL[] = "中文 (繁體)";
|
||||
const char C_LOCALE_CHINESE_SIMPLIFIED[] = "中文 (简体)";
|
||||
const char C_LOCALE_CHINESE_TRADITIONAL_TW[] = "正體中文 (臺灣)";
|
||||
const char C_LOCALE_CHINESE_TRADITIONAL_HK[] = "繁體中文 (香港)";
|
||||
const char C_LOCALE_CHINESE_SIMPLIFIED[] = "简体中文";
|
||||
const char C_LOCALE_KOREAN[] = "한글";
|
||||
|
@ -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: {
|
||||
|
@ -40,7 +40,8 @@
|
||||
<file>lang/qbittorrent_tr.qm</file>
|
||||
<file>lang/qbittorrent_uk.qm</file>
|
||||
<file>lang/qbittorrent_vi.qm</file>
|
||||
<file>lang/qbittorrent_zh_Hans.qm</file>
|
||||
<file>lang/qbittorrent_zh_Hant.qm</file>
|
||||
<file>lang/qbittorrent_zh.qm</file>
|
||||
<file>lang/qbittorrent_zh_TW.qm</file>
|
||||
<file>lang/qbittorrent_zh_HK.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="zh-Hans">
|
||||
<TS version="2.0" language="zh">
|
||||
<context>
|
||||
<name>AboutDlg</name>
|
||||
<message>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="zh-Hant">
|
||||
<TS version="2.0" language="zh_HK">
|
||||
<context>
|
||||
<name>AboutDlg</name>
|
||||
<message>
|
6512
src/lang/qbittorrent_zh_TW.ts
Normal file
6512
src/lang/qbittorrent_zh_TW.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -75,8 +75,9 @@ RESOURCES += \
|
||||
# Translations
|
||||
TRANSLATIONS = \
|
||||
$$LANG_PATH/qbittorrent_fr.ts \
|
||||
$$LANG_PATH/qbittorrent_zh_Hans.ts \
|
||||
$$LANG_PATH/qbittorrent_zh_Hant.ts \
|
||||
$$LANG_PATH/qbittorrent_zh.ts \
|
||||
$$LANG_PATH/qbittorrent_zh_TW.ts \
|
||||
$$LANG_PATH/qbittorrent_zh_HK.ts \
|
||||
$$LANG_PATH/qbittorrent_en.ts \
|
||||
$$LANG_PATH/qbittorrent_en_AU.ts \
|
||||
$$LANG_PATH/qbittorrent_en_GB.ts \
|
||||
|
@ -331,8 +331,9 @@
|
||||
<option value="be_BY">Беларуская</option>
|
||||
<option value="eu_ES">Euskara</option>
|
||||
<option value="vi_VN">tiếng Việt</option>
|
||||
<option value="zh_Hans">中文 (简体)</option>
|
||||
<option value="zh_Hant">中文 (繁體)</option>
|
||||
<option value="zh">中文 (简体)</option>
|
||||
<option value="zh_TW">繁體中文(臺灣)</option>
|
||||
<option value="zh_HK">繁體中文(香港)</option>
|
||||
<option value="ko_KR">한글</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
|
Loading…
x
Reference in New Issue
Block a user