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

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