Load Chinese translations correcly

Load Simplified and Traditional Chinese correctly via System
Language option.

This change is only valid with Qt 5.

Task-number: QTCREATORBUG-8253
Change-Id: I068c96d26e97ff534004ae53747dd6fc460edee2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Liang Qi
2012-11-23 11:06:46 +01:00
committed by Eike Ziller
parent 0f0fa3c270
commit deeef5308f

View File

@@ -356,7 +356,11 @@ int main(int argc, char **argv)
const QString &creatorTrPath = QCoreApplication::applicationDirPath() const QString &creatorTrPath = QCoreApplication::applicationDirPath()
+ QLatin1String(SHARE_PATH "/translations"); + QLatin1String(SHARE_PATH "/translations");
foreach (QString locale, uiLanguages) { foreach (QString locale, uiLanguages) {
#if (QT_VERSION >= 0x050000)
locale = QLocale(locale).name();
#else
locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973
#endif
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
const QString &qtTrFile = QLatin1String("qt_") + locale; const QString &qtTrFile = QLatin1String("qt_") + locale;