From 5c7cab9bc22504d9b24ca139391c743003c7a38a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 22 Sep 2026 11:31:49 +0000 Subject: [PATCH] :globe_with_meridians: Keep unused placeholders out of the gate Reverts the %s-stripping on unused auth.terms-privacy-agreement: the links mirror its markdown sibling and a reactivation may need them. Placeholder mismatches on #, unused keys now warn instead of failing, and the rule is recorded in mem:frontend/translations. AI-assisted-by: muse-spark-1.3-contributor --- .serena/memories/frontend/translations.md | 4 +++- frontend/scripts/translations.js | 8 +++++++- frontend/translations/es.po | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.serena/memories/frontend/translations.md b/.serena/memories/frontend/translations.md index 5cce5b01fc..c527af8b2a 100644 --- a/.serena/memories/frontend/translations.md +++ b/.serena/memories/frontend/translations.md @@ -69,7 +69,9 @@ high-coverage support reference, never the base. - Placeholder parity per entry (singular AND each plural form, also enforced by the script); verify `%s` against the `tr` call site when `en`/`es`/code disagree (a `%s` the code never passes - renders literally; a dropped one swallows the argument). + renders literally; a dropped one swallows the argument). On + `#, unused` keys the script only warns: never "fix" them by + deleting placeholders or links, a reactivation may need them. - Glued words (AI batches drop spaces at wrap boundaries): the script flags function-word splits (`del'equip`, `lapolítica`, `sinecessiteu`), `,/.`/`:` without following space, diff --git a/frontend/scripts/translations.js b/frontend/scripts/translations.js index 04b832f332..e4e2e50c1b 100755 --- a/frontend/scripts/translations.js +++ b/frontend/scripts/translations.js @@ -604,11 +604,17 @@ async function check(locale, words) { const textEs = textsEs[i] ?? ""; const refs = refToks(textEn, textEs); if (textEn) { + const unused = (e.comments?.flag ?? "") + .split(/,\s*/) + .includes("unused"); for (const re of PLACEHOLDER_RES) { const nEn = countIn(textEn, re); const nLoc = countIn(text, re); if (nEn !== nLoc) { - errors.push( + // Unused keys are never rendered: report, don't fail. + // "Fixing" them by deleting placeholders can destroy + // content that a reactivation may need. + (unused ? warnings : errors).push( `${msgid}[${i}]: placeholder mismatch ${re.source}: en=${nEn} ${locale}=${nLoc}`, ); } diff --git a/frontend/translations/es.po b/frontend/translations/es.po index e868e2383b..edc0b28c0b 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -196,8 +196,8 @@ msgstr "Términos de servicio" #, unused msgid "auth.terms-privacy-agreement" msgstr "" -"Al crear una nueva cuenta, aceptas nuestros términos de servicio y política " -"de privacidad." +"Al crear una nueva cuenta, aceptas nuestros [términos de servicio](%s) y " +"[política de privacidad](%s)." #: src/app/main/ui/auth/register.cljs:238 #, unused