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: con <qtc-committer@nokia.com>
This commit is contained in:
Daniel Molkentin
2009-06-10 13:27:05 +02:00
parent 649e0acda7
commit bebb155925
3 changed files with 23 additions and 11 deletions

View File

@@ -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