From d642faf1d872a88fb34b1a90d0b270dfc984045f Mon Sep 17 00:00:00 2001 From: Mika Attila Date: Thu, 16 Jan 2014 13:04:59 +0100 Subject: [PATCH] gui: Only load embedded translation if it doesn't exist in lang/ This makes it easier to test/override translations --- gui/translationhandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp index b2d0ad8c0..3a9b30253 100644 --- a/gui/translationhandler.cpp +++ b/gui/translationhandler.cpp @@ -97,7 +97,12 @@ bool TranslationHandler::SetLanguage(const QString &code) mTranslator = new QTranslator(this); //Load the new language - QString translationFile = ":/" + mTranslations[index].mFilename; + QString translationFile = "lang/" + mTranslations[index].mFilename; + + if (!QFile::exists(translationFile + ".qm")) { + translationFile = ":/" + mTranslations[index].mFilename; + } + if (!mTranslator->load(translationFile) && !failure) { translationFile += ".qm"; //If it failed, lets check if the default file exists