From 015bdc793078cb8081b29922f6fed66e2cccf880 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 20 Jan 2011 16:14:23 +0000 Subject: [PATCH] =?UTF-8?q?Improved=20UI=20translation=20(Thanks=20=D0=92?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=93=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=D0=BD=D1=91=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 6f1cfe12b..ad178b492 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #ifndef DISABLE_GUI #include @@ -196,11 +197,20 @@ int main(int argc, char *argv[]){ // Load translation locale = settings.value(QString::fromUtf8("Preferences/General/Locale"), QString()).toString(); + QTranslator qtTranslator; QTranslator translator; if(locale.isEmpty()){ locale = QLocale::system().name(); settings.setValue(QString::fromUtf8("Preferences/General/Locale"), locale); } + if(qtTranslator.load( + QString::fromUtf8("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath) + )){ + qDebug("Qt %s locale recognized, using translation.", qPrintable(locale)); + }else{ + qDebug("Qt %s locale unrecognized, using default (en_GB).", qPrintable(locale)); + } + app.installTranslator(&qtTranslator); if(translator.load(QString::fromUtf8(":/lang/qbittorrent_") + locale)){ qDebug("%s locale recognized, using translation.", qPrintable(locale)); }else{