From deeef5308f1b3d59581aa1a65e781d434719a40d Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 23 Nov 2012 11:06:46 +0100 Subject: [PATCH] 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 Reviewed-by: Eike Ziller --- src/app/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/main.cpp b/src/app/main.cpp index 557678fafcf..95c1a1e5320 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -356,7 +356,11 @@ int main(int argc, char **argv) const QString &creatorTrPath = QCoreApplication::applicationDirPath() + QLatin1String(SHARE_PATH "/translations"); foreach (QString locale, uiLanguages) { +#if (QT_VERSION >= 0x050000) + locale = QLocale(locale).name(); +#else locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 +#endif if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrFile = QLatin1String("qt_") + locale;