🌐 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
This commit is contained in:
Andrey Antukh 2026-09-22 11:31:49 +00:00
parent 30d74fb145
commit 5c7cab9bc2
3 changed files with 12 additions and 4 deletions

View File

@ -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,

View File

@ -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}`,
);
}

View File

@ -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