summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
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/lupdate
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/lupdate')
-rw-r--r--tools/linguist/lupdate/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index a575192..0ff5288 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -52,6 +52,8 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QTextCodec>
+#include <QtCore/QTranslator>
+#include <QtCore/QLibraryInfo>
#include <iostream>
@@ -410,6 +412,16 @@ static void processProjects(
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
+ 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);
+ }
+
m_defaultExtensions = QLatin1String("java,jui,ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx,js,qs,qml");
QStringList args = app.arguments();