diff options
author | Tasuku Suzuki <tasuku.suzuki@nokia.com> | 2010-08-20 10:36:15 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-08-20 10:50:34 (GMT) |
commit | a4d2844c99481fc7764ffd8436a2b79531a58d8b (patch) | |
tree | d8bc243d0549fb0480f0348fee4af483a937a0a0 /tools/qtconfig | |
parent | a3aeebff0afed0e974d20b088b14cdf2efa89d2b (diff) | |
download | Qt-a4d2844c99481fc7764ffd8436a2b79531a58d8b.zip Qt-a4d2844c99481fc7764ffd8436a2b79531a58d8b.tar.gz Qt-a4d2844c99481fc7764ffd8436a2b79531a58d8b.tar.bz2 |
qtconfig and qvfb internationalization fixes
- install QTranslators in qtconfig and qvfb
- add tr() to qvfb strings
Merge-request: 783
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools/qtconfig')
-rw-r--r-- | tools/qtconfig/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp index 24d044f..928cf01 100644 --- a/tools/qtconfig/main.cpp +++ b/tools/qtconfig/main.cpp @@ -42,6 +42,9 @@ #include "ui_previewwidgetbase.h" #include "mainwindow.h" #include <QApplication> +#include <QLibraryInfo> +#include <QLocale> +#include <QTranslator> QT_USE_NAMESPACE @@ -50,6 +53,17 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(qtconfig); QApplication app(argc, argv); + + QTranslator translator; + QTranslator qtTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("qtconfig_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + } + MainWindow mw; mw.show(); return app.exec(); |