diff --git a/internal/check-hardcoded-english.mjs b/internal/check-hardcoded-english.mjs index 9c62f08f0..b64fdfe13 100644 --- a/internal/check-hardcoded-english.mjs +++ b/internal/check-hardcoded-english.mjs @@ -80,6 +80,19 @@ const ALLOW = [ // A trailing separator is allowed because that is the shape of an id PREFIX built by // interpolation — `id="country-${code}"` leaves the quasi "country-". test: (s) => s.split(/\s+/).every((tok) => /^[a-z][a-z0-9]*(?:[-_]{1,2}[a-z0-9]*)+$/.test(tok)) }, + { why: 'CSS FUNCTION FRAGMENTS left by splitting a template literal. A quasi is judged alone, so ' + + '`url(${base}/x.svg)` is tested as "url(" and "/x.svg)", and `repeat(${n}, minmax(0, 1fr))` ' + + 'as "repeat(" and ", minmax(0, 1fr))". The WHOLE string is obviously CSS and the existing CSS ' + + 'shape matches it, but no fragment carries a brace or a colon-value pair, so each one fell ' + + 'through and was reported as English. Measured 2026-09-29: this was 3 of my 94 findings.', + test: (s) => /^[a-z-]+\($/.test(s) + || /^[,)\s]*[a-z-]+\([^)]*\)[,)\s]*$/.test(s) + || /^[,)\s]+$/.test(s) }, + { why: 'ID PREFIXES ending in a COLON, built by interpolation: `fam:${x}`, `dial:${x}`, and ' + + 'localStorage keys like `pgg-cards-per-row:${profile}`. The hyphen rule below covers a ' + + 'trailing separator but not a colon, so these read as prose. A prefix is not a sentence: ' + + 'it is one lowercase token, no spaces, ending at the separator.', + test: (s) => /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*:$/.test(s) }, { why: 'font family names: typeface identifiers, never translated', test: (s) => /^(Bebas Neue|Poppins|Oswald|Figtree|Segoe UI|Helvetica Neue|Times New Roman)$/.test(s) }, { why: 'engine/provider tokens and well-known proper nouns that are not prose',