Rename Chinese translation files. Closes #2936.

This commit is contained in:
sledgehammer999 2015-06-15 00:13:52 +03:00
parent c259666e43
commit fb7ba92f69
7 changed files with 35 additions and 11 deletions

View file

@ -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);
}