Skip to content

Commit d642faf

Browse files
gui: Only load embedded translation if it doesn't exist in lang/
This makes it easier to test/override translations
1 parent fb4695f commit d642faf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

gui/translationhandler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ bool TranslationHandler::SetLanguage(const QString &code)
9797
mTranslator = new QTranslator(this);
9898

9999
//Load the new language
100-
QString translationFile = ":/" + mTranslations[index].mFilename;
100+
QString translationFile = "lang/" + mTranslations[index].mFilename;
101+
102+
if (!QFile::exists(translationFile + ".qm")) {
103+
translationFile = ":/" + mTranslations[index].mFilename;
104+
}
105+
101106
if (!mTranslator->load(translationFile) && !failure) {
102107
translationFile += ".qm";
103108
//If it failed, lets check if the default file exists

0 commit comments

Comments
 (0)