summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-04-02 11:19:25 (GMT)
committerhjk <qtc-committer@nokia.com>2009-04-02 11:19:25 (GMT)
commit7887095d3a95335251e5c82c3ac7069c5d05a30d (patch)
tree6d6a25f54ef6a84594ac873cda545f12e2036aa3
parentd399b858f9f3c50c82da197cd8bdd05110a092fe (diff)
downloadQt-7887095d3a95335251e5c82c3ac7069c5d05a30d.zip
Qt-7887095d3a95335251e5c82c3ac7069c5d05a30d.tar.gz
Qt-7887095d3a95335251e5c82c3ac7069c5d05a30d.tar.bz2
fix 223949: Qt's translation should be installed only if Linguists
translation is found
-rw-r--r--tools/linguist/linguist/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/linguist/linguist/main.cpp b/tools/linguist/linguist/main.cpp
index 018fbc5..a6a0d27 100644
--- a/tools/linguist/linguist/main.cpp
+++ b/tools/linguist/linguist/main.cpp
@@ -80,12 +80,15 @@ int main(int argc, char **argv)
}
QTranslator translator;
- translator.load(QLatin1String("linguist_") + QLocale::system().name(), resourceDir);
- app.installTranslator(&translator);
-
QTranslator qtTranslator;
- qtTranslator.load(QLatin1String("qt_") + QLocale::system().name(), resourceDir);
- app.installTranslator(&qtTranslator);
+ QString sysLocale = QLocale::system().name();
+ if (translator.load(QLatin1String("linguist_") + sysLocale, resourceDir)) {
+ app.installTranslator(&translator);
+ if (qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir))
+ app.installTranslator(&qtTranslator);
+ else
+ app.removeTranslator(&translator);
+ }
app.setOrganizationName(QLatin1String("Trolltech"));
app.setApplicationName(QLatin1String("Linguist"));