Merge pull request #220 from crumblingstatue/lang_embed_fallback

gui: Only load embedded translation if it doesn't exist in lang/
This commit is contained in:
Daniel Marjamäki 2014-01-16 08:00:25 -08:00
commit 45c9a63157
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