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/qvfb/main.cpp | |
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/qvfb/main.cpp')
-rw-r--r-- | tools/qvfb/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/qvfb/main.cpp b/tools/qvfb/main.cpp index d96b255..28aa7d4 100644 --- a/tools/qvfb/main.cpp +++ b/tools/qvfb/main.cpp @@ -43,6 +43,9 @@ #include <QApplication> #include <QRegExp> +#include <QLibraryInfo> +#include <QLocale> +#include <QTranslator> #include <stdlib.h> #include <stdio.h> #include <signal.h> @@ -73,6 +76,16 @@ int runQVfb( int argc, char *argv[] ) QApplication app( argc, argv ); + QTranslator translator; + QTranslator qtTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("qvfb_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + } + int width = 0; int height = 0; int depth = -32; // default, but overridable by skin |