mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-09 15:38:39 +01:00
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).
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user