# HG changeset patch # User sheepluva # Date 1452451543 -3600 # Node ID 84eb32d9e2791700baada0ed1b88cdbf5429bbdc # Parent 8e221d2a368e1c6be1156b2b081830256b4a87bb# Parent 637fb0558a73a535dc9f7c641772148c39792e64 merge Wuzzy's qttranslation bookmark diff -r 8e221d2a368e -r 84eb32d9e279 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sun Jan 10 18:01:17 2016 +0100 +++ b/QTfrontend/main.cpp Sun Jan 10 19:45:43 2016 +0100 @@ -28,6 +28,7 @@ #include #include #include +#include #include "hwform.h" #include "hwconsts.h" @@ -318,7 +319,8 @@ engine->setWriteDir(cfgdir->absolutePath()); engine->mountPacks(); - QTranslator Translator; + QTranslator TranslatorHedgewars; + QTranslator TranslatorQt; { QSettings settings(DataManager::instance().settingsFileName(), QSettings::IniFormat); settings.setIniCodec("UTF-8"); @@ -333,10 +335,13 @@ cc = HWApplication::keyboardInputLocale().name(); } - // load locale file into translator - if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) - qWarning("Failed to install translation (%s)", qPrintable(cc)); - app.installTranslator(&Translator); + // Load locale files into translators + if (!TranslatorHedgewars.load(QString("physfs://Locale/hedgewars_%1").arg(cc))) + qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc)); + if (!TranslatorQt.load(QString("%1/qt_%2").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath), cc))) + qWarning("Failed to install Qt translation (%s)", qPrintable(cc)); + app.installTranslator(&TranslatorHedgewars); + app.installTranslator(&TranslatorQt); app.setLayoutDirection(QLocale(cc).textDirection()); }