diff --git a/src/app/main.cpp b/src/app/main.cpp index 5199c7c7e64e8f2f6185ba0525137a85d6fadebe..1cb2b8e8e952a4071b1ac28ad59486ce92ddbcfe 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -217,11 +217,13 @@ int main(int argc, char **argv) QTranslator translator; QTranslator qtTranslator; const QString &locale = QLocale::system().name(); - if (translator.load(QLatin1String("qtcreator_") + locale, - QCoreApplication::applicationDirPath() - + QLatin1String(SHARE_PATH "/translations"))) { - if (qtTranslator.load(QLatin1String("qt_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { + const QString &creatorTrPath = QCoreApplication::applicationDirPath() + + QLatin1String(SHARE_PATH "/translations"); + if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &qtTrFile = QLatin1String("qt_") + locale; + // Binary installer puts Qt tr files into creatorTrPath + if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) { app.installTranslator(&translator); app.installTranslator(&qtTranslator); app.setProperty("qtc_locale", locale); diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 8962f2f714abfea35cfd88f86c1afb2609621989..6227c0ff285218fd1e79e0282ef92ef214837707 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -121,9 +121,12 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error) QString locale = qApp->property("qtc_locale").toString(); if (!locale.isEmpty()) { QTranslator *qtr = new QTranslator(this); - qtr->load(QLatin1String("designer_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - qApp->installTranslator(qtr); + const QString &creatorTrPath = + Core::ICore::instance()->resourcePath() + QLatin1String("/translations"); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &trFile = QLatin1String("designer_") + locale; + if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath)) + qApp->installTranslator(qtr); } error->clear(); diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 726d3d47d12bcfeeddac5b1f910a35ae0f02beb3..ae2baa25a7cd6fbccd0d934384dfecd886a307d8 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -141,9 +141,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) QString locale = qApp->property("qtc_locale").toString(); if (!locale.isEmpty()) { QTranslator *qtr = new QTranslator(this); - qtr->load(QLatin1String("assistant_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - qApp->installTranslator(qtr); + QTranslator *qhelptr = new QTranslator(this); + const QString &creatorTrPath = + Core::ICore::instance()->resourcePath() + QLatin1String("/translations"); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &trFile = QLatin1String("assistant_") + locale; + const QString &helpTrFile = QLatin1String("qt_help_") + locale; + if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath)) + qApp->installTranslator(qtr); + if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath)) + qApp->installTranslator(qhelptr); } #ifndef QT_NO_WEBKIT