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:
parent
fb4695fcb4
commit
d642faf1d8
|
@ -97,7 +97,12 @@ bool TranslationHandler::SetLanguage(const QString &code)
|
||||||
mTranslator = new QTranslator(this);
|
mTranslator = new QTranslator(this);
|
||||||
|
|
||||||
//Load the new language
|
//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) {
|
if (!mTranslator->load(translationFile) && !failure) {
|
||||||
translationFile += ".qm";
|
translationFile += ".qm";
|
||||||
//If it failed, lets check if the default file exists
|
//If it failed, lets check if the default file exists
|
||||||
|
|
Loading…
Reference in New Issue