gui: Only load embedded translation if it doesn't exist in lang/

This makes it easier to test/override translations
This commit is contained in:
Mika Attila 2014-01-16 13:04:59 +01:00
parent fb4695fcb4
commit d642faf1d8
1 changed files with 6 additions and 1 deletions

View File

@ -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