diff --git a/kcms/translations/package/contents/ui/main.qml b/kcms/translations/package/contents/ui/main.qml index f643bfec8..ba498880f 100644 --- a/kcms/translations/package/contents/ui/main.qml +++ b/kcms/translations/package/contents/ui/main.qml @@ -157,11 +157,18 @@ ScrollViewKCM { type: Kirigami.MessageType.Error - text: i18ncp("@info %2 is the language code", - "The translation files for the language with the code '%2' could not be found. The language will be removed from your configuration. If you want to add it back, please install the localization files for it and add the language again.", - "The translation files for the languages with the codes '%2' could not be found. These languages will be removed from your configuration. If you want to add them back, please install the localization files for it and add the languages again.", - kcm.selectedTranslationsModel.missingLanguages.length, - kcm.selectedTranslationsModel.missingLanguages.join(i18nc("@info separator in list of language codes", "', '"))) + text: { + // Don't eval the i18ncp call when we have no missing languages. It causes unnecesssary warnings + // as %2 will be "" and thus considered missing. + if (!visible) { + return "" + } + i18ncp("@info %2 is the language code", + "The translation files for the language with the code '%2' could not be found. The language will be removed from your configuration. If you want to add it back, please install the localization files for it and add the language again.", + "The translation files for the languages with the codes '%2' could not be found. These languages will be removed from your configuration. If you want to add them back, please install the localization files for it and add the languages again.", + kcm.selectedTranslationsModel.missingLanguages.length, + kcm.selectedTranslationsModel.missingLanguages.join(i18nc("@info separator in list of language codes", "', '"))) + } visible: kcm.selectedTranslationsModel.missingLanguages.length > 0 }