mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Rename Chinese translation files. Closes #2936.
This commit is contained in:
parent
c259666e43
commit
fb7ba92f69
7 changed files with 35 additions and 11 deletions
|
@ -337,8 +337,20 @@ void Application::initializeTranslation()
|
|||
Preferences* const pref = Preferences::instance();
|
||||
// Load translation
|
||||
QString locale = pref->getLocale();
|
||||
|
||||
if (locale.isEmpty()) {
|
||||
locale = QLocale::system().name();
|
||||
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();
|
||||
}
|
||||
|
||||
pref->setLocale(locale);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue