From 959b9fc1fb556caa6e48c172750e64acc4e86984 Mon Sep 17 00:00:00 2001 From: Gauvino Date: Mon, 8 Jun 2026 16:50:50 +0200 Subject: [PATCH] chore(i18n): document allow-list groups + the static-only MISSING check Addresses review nits on the lean PR: - expand _ignoreUnusedNote to explain why the watchlists.*/pin.*/player.* keys are exempt (planned features, not yet wired), alongside the three tracked by issues #1702/#1703/#1704. - note that MISSING validation only covers static t()/i18nKey keys; a key stored as a bare string constant and resolved via t(variable) is treated as used but its existence is not checked (static analysis cannot resolve runtime keys). --- scripts/check-i18n-keys.mjs | 5 +++++ scripts/i18n-keys.config.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check-i18n-keys.mjs b/scripts/check-i18n-keys.mjs index 437b4101f..0e20e462e 100644 --- a/scripts/check-i18n-keys.mjs +++ b/scripts/check-i18n-keys.mjs @@ -184,6 +184,11 @@ const unused = sourceKeys.filter((k) => !isUsed(k)).sort(); const missing = [...usedStatic] .filter((k) => KEY_SHAPE.test(k) && !sourceKeySet.has(k)) .sort(); +// Known limitation: only keys seen in a static t("…") / i18nKey="…" / t(`…`) call are +// validated for MISSING. A key stored as a bare string constant and resolved via t(variable) +// counts as USED (via literalUsed → not flagged unused) but its existence in en.json is not +// checked here — static analysis can't resolve which key a runtime variable holds. Streamyfin +// keys are static literals in practice; revisit if dynamic key constants become common. // ---- optional fix: strip dead keys from the source locale (en.json) ---- const removeKey = (obj, parts) => { diff --git a/scripts/i18n-keys.config.json b/scripts/i18n-keys.config.json index 2ae8f72af..216e42f66 100644 --- a/scripts/i18n-keys.config.json +++ b/scripts/i18n-keys.config.json @@ -22,7 +22,7 @@ "build", "translations" ], - "_ignoreUnusedNote": "Keys for planned features that are intentionally kept in en.json but not yet wired in code. They are exempt from the unused-key check until implemented. Remove an entry once its feature ships and uses the key. Pending implementation: home.settings.other.show_large_home_carousel (#1702 media-bar), home.settings.logs.delete_all_logs (#1703 iOS logs fix), home.suggested_episodes (#1704).", + "_ignoreUnusedNote": "Keys for planned features intentionally kept in en.json but not yet wired in code — exempt from the unused-key check until implemented. Remove an entry once its feature ships and uses the key. Groups below: watchlists.* = watchlist actions not yet wired; pin.* = PIN confirm flow not yet wired; player.* = in-player subtitle search + swipe-down settings + stop-playback confirm, not yet wired; the last three are tracked by issues: home.settings.other.show_large_home_carousel (#1702 media-bar), home.settings.logs.delete_all_logs (#1703 iOS logs fix), home.suggested_episodes (#1704).", "ignoreUnused": [ "watchlists.add_to_watchlist", "watchlists.remove_from_watchlist",