From 640e52d4b4a2da630038ae2bb5e2ddda7948a6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 18 Nov 2022 20:37:55 +0100 Subject: [PATCH] Report missing translation keys only once. --- OpenRA.Mods.Common/Lint/CheckTranslationReference.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index c8261f6fd9..53da1338e3 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -49,6 +49,9 @@ namespace OpenRA.Mods.Common.Lint var keys = LintExts.GetFieldValues(traitInfo, field); foreach (var key in keys) { + if (referencedKeys.Contains(key)) + continue; + if (!translation.HasMessage(key)) emitError($"{key} not present in {language} translation."); @@ -78,6 +81,9 @@ namespace OpenRA.Mods.Common.Lint continue; var key = (string)fieldInfo.GetValue(string.Empty); + if (referencedKeys.Contains(key)) + continue; + if (!translation.HasMessage(key)) emitError($"{key} not present in {language} translation.");