summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2021-05-03 15:27:54 +0300
committerKatja Marttila <katja.marttila@qt.io>2021-05-06 10:41:45 +0000
commit33334e2a8aa9d847172d1f6c1cf9a447dce094f9 (patch)
tree2a0ce4ca45e67149ffef969ef47ad3bc1b6128f3
parent14b12d2730bbde50dac8c81d4aef45ef78c48391 (diff)
Fix component translation loading
Component translations were following the system language although allowed languages were set in config.xml using <Translations> field. Also the translation file name was not correct as IFW languages has the syntax 'ifw_<language>'. Task-number: QTIFW-2220 Change-Id: I6a6f19351cbb956accbc22bc532f7a12dde21a2f Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r--src/libs/installer/component.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 66f333377..cb9959ba3 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -617,15 +617,15 @@ void Component::loadTranslations(const QDir &directory, const QStringList &qms)
while (it.hasNext()) {
const QString filename = it.next();
const QString basename = QFileInfo(filename).baseName();
- if (!uiLanguage.startsWith(QFileInfo(filename).baseName(), Qt::CaseInsensitive))
- continue; // do not load the file if it does not match the UI language
if (!translations.isEmpty()) {
bool found = false;
foreach (const QString &translation, translations)
- found |= translation.startsWith(basename, Qt::CaseInsensitive);
+ found |= translation.startsWith(QLatin1String("ifw_") + basename, Qt::CaseInsensitive);
if (!found) // don't load the file if it does match the UI language but is not allowed to be used
continue;
+ } else if (!uiLanguage.startsWith(QFileInfo(filename).baseName(), Qt::CaseInsensitive)) {
+ continue; // do not load the file if it does not match the UI language
}
QScopedPointer<QTranslator> translator(new QTranslator(this));