Moved GUI translations into subdirectory /lang
This commit is contained in:
parent
197046b761
commit
2413655d3d
|
@ -97,18 +97,20 @@ bool TranslationHandler::SetLanguage(const QString &code)
|
||||||
mTranslator = new QTranslator(this);
|
mTranslator = new QTranslator(this);
|
||||||
|
|
||||||
//Load the new language
|
//Load the new language
|
||||||
if (!mTranslator->load(mTranslations[index].mFilename) && !failure) {
|
QString translationFile = "lang/" + mTranslations[index].mFilename;
|
||||||
|
if (!mTranslator->load(translationFile) && !failure) {
|
||||||
|
translationFile += ".qm";
|
||||||
//If it failed, lets check if the default file exists
|
//If it failed, lets check if the default file exists
|
||||||
if (!QFile::exists(mTranslations[index].mFilename + ".qm")) {
|
if (!QFile::exists(translationFile)) {
|
||||||
error = QObject::tr("Language file %1 not found!");
|
error = QObject::tr("Language file %1 not found!");
|
||||||
error = error.arg(mTranslations[index].mFilename + ".qm");
|
error = error.arg(translationFile);
|
||||||
failure = true;
|
failure = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If file exists, there's something wrong with it
|
//If file exists, there's something wrong with it
|
||||||
error = QObject::tr("Failed to load translation for language %1 from file %2");
|
error = QObject::tr("Failed to load translation for language %1 from file %2");
|
||||||
error = error.arg(mTranslations[index].mName);
|
error = error.arg(mTranslations[index].mName);
|
||||||
error = error.arg(mTranslations[index].mFilename + ".qm");
|
error = error.arg(translationFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failure) {
|
if (failure) {
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<File Id='qtcore4dll' Name='qtcore4.dll' Source='$(var.QtDllDir)\qtcore4.dll' />
|
<File Id='qtcore4dll' Name='qtcore4.dll' Source='$(var.QtDllDir)\qtcore4.dll' />
|
||||||
<File Id='qtgui4dll' Name='qtgui4.dll' Source='$(var.QtDllDir)\qtgui4.dll' />
|
<File Id='qtgui4dll' Name='qtgui4.dll' Source='$(var.QtDllDir)\qtgui4.dll' />
|
||||||
</Component>
|
</Component>
|
||||||
|
<Directory Id='TranslationsFolder' Name='lang'>
|
||||||
<Component Id='GuiTranslations' Guid='$(var.guiTranslationsGUID)'>
|
<Component Id='GuiTranslations' Guid='$(var.guiTranslationsGUID)'>
|
||||||
<File Id='cppcheck_de.qm' Name='cppcheck_de.qm' Source='$(var.TranslationsDir)\cppcheck_de.qm' />
|
<File Id='cppcheck_de.qm' Name='cppcheck_de.qm' Source='$(var.TranslationsDir)\cppcheck_de.qm' />
|
||||||
<File Id='cppcheck_es.qm' Name='cppcheck_es.qm' Source='$(var.TranslationsDir)\cppcheck_es.qm' />
|
<File Id='cppcheck_es.qm' Name='cppcheck_es.qm' Source='$(var.TranslationsDir)\cppcheck_es.qm' />
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
<File Id='cppcheck_sr.qm' Name='cppcheck_sr.qm' Source='$(var.TranslationsDir)\cppcheck_sr.qm' />
|
<File Id='cppcheck_sr.qm' Name='cppcheck_sr.qm' Source='$(var.TranslationsDir)\cppcheck_sr.qm' />
|
||||||
<File Id='cppcheck_zh_CN.qm' Name='cppcheck_zh_CN.qm' Source='$(var.TranslationsDir)\cppcheck_zh_CN.qm' />
|
<File Id='cppcheck_zh_CN.qm' Name='cppcheck_zh_CN.qm' Source='$(var.TranslationsDir)\cppcheck_zh_CN.qm' />
|
||||||
</Component>
|
</Component>
|
||||||
|
</Directory>
|
||||||
<Directory Id='CfgsFolder' Name='cfg'>
|
<Directory Id='CfgsFolder' Name='cfg'>
|
||||||
<Component Id='Cfgs' Guid='$(var.cfgsGUID)'>
|
<Component Id='Cfgs' Guid='$(var.cfgsGUID)'>
|
||||||
<File Id='std.cfg' Name='std.cfg' Source='$(var.CfgsDir)\std.cfg' />
|
<File Id='std.cfg' Name='std.cfg' Source='$(var.CfgsDir)\std.cfg' />
|
||||||
|
|
Loading…
Reference in New Issue