Commit bebb1559 authored by Daniel Molkentin's avatar Daniel Molkentin

Also search for Qt tr cataloges in the Creator tr dir. Add qt_help cataloge.

The qt_help cataloge is required to fully translate the help plugin. The
additional lookup is mandated by the binary packages, where the translations
are simply put in Creatrors translation directories and the Qt translation
path is invalid.
Reviewed-by: default avatarcon <qtc-committer@nokia.com>
parent 649e0acd
......@@ -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);
......
......@@ -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();
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment