summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lconvert
diff options
context:
space:
mode:
authorVictor Ostashevsky <ostash@ostash.kiev.ua>2010-09-01 08:47:54 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-01 09:35:44 (GMT)
commit6f143533666ff88c359cb7ad929e35b4decb556f (patch)
treee6fc6af621e74865695f6c24b1e9248954348dde /tools/linguist/lconvert
parent1f5d88dd327be635966ed9e3811c8803a163b2a4 (diff)
downloadQt-6f143533666ff88c359cb7ad929e35b4decb556f.zip
Qt-6f143533666ff88c359cb7ad929e35b4decb556f.tar.gz
Qt-6f143533666ff88c359cb7ad929e35b4decb556f.tar.bz2
Enable loading/generating translations by assistant and linguist tools
QTranslator is installed in tools (qcollectiongenerator, qhelpconverter, qhelpgenerator, lconvert, lrelease, lupdate). Build targets that updates .ts files are changed to include strings from this tools. Merge-request: 2456 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools/linguist/lconvert')
-rw-r--r--tools/linguist/lconvert/main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp
index 094406c..e7c1d9a 100644
--- a/tools/linguist/lconvert/main.cpp
+++ b/tools/linguist/lconvert/main.cpp
@@ -45,6 +45,8 @@
#include <QtCore/QDebug>
#include <QtCore/QString>
#include <QtCore/QStringList>
+#include <QtCore/QTranslator>
+#include <QtCore/QLibraryInfo>
#include <iostream>
@@ -134,8 +136,17 @@ struct File
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
- QStringList args = app.arguments();
+ QTranslator translator;
+ QTranslator qtTranslator;
+ QString sysLocale = QLocale::system().name();
+ QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
+ if (translator.load(QLatin1String("linguist_") + sysLocale, resourceDir)
+ && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir)) {
+ app.installTranslator(&translator);
+ app.installTranslator(&qtTranslator);
+ }
+ QStringList args = app.arguments();
QList<File> inFiles;
QString inFormat(QLatin1String("auto"));
QString outFileName;