From 8201a57b107d4280af5c887b5a283cb196dfe025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Jul 2022 09:50:38 +0200 Subject: [PATCH] Don't complain about re-usable terms not getting referenced. --- OpenRA.Mods.Common/Lint/CheckTranslationReference.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index 83759eb970..1cf5fa915b 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -61,8 +61,11 @@ namespace OpenRA.Mods.Common.Lint foreach (var entry in result.Entries) { - if (!referencedKeys.Contains(entry.GetId())) - emitWarning($"Unused key `{entry.GetId()}` in {file}."); + // Don't flag definitions referenced (only) within the .ftl definitions as unused + var isReusableTerm = entry.GetType() == typeof(AstTerm); + var key = entry.GetId(); + if (!referencedKeys.Contains(key) && !isReusableTerm) + emitWarning($"Unused key `{key}` in {file}."); variableReferences.Clear(); if (entry is AstMessage message)