Skip to content

test(frontend): add locale-completeness coverage for /learn content - #199

Merged
ihabkhaled merged 2 commits into
mainfrom
test/learn-content-locale-completeness
Sep 1, 2026
Merged

test(frontend): add locale-completeness coverage for /learn content#199
ihabkhaled merged 2 commits into
mainfrom
test/learn-content-locale-completeness

Conversation

@ihabkhaled

Copy link
Copy Markdown
Owner

Summary

Follow-up to the AdSense remediation audit (PR #198). That audit found
/learn content clean across all 13 locales, but flagged a real gap: the
four existing locale-completeness tests (persian-locale-completeness,
japanese-completeness, thai-completeness, chinese-completeness) all
assert against the general UI dictionary — none of them touch the actual
/learn article content, and ar, fr, hi, ru had no locale-specific
translation test of any kind.

  • Adds learn-content-locale-completeness.test.ts: one parameterized test
    across all 13 locales checking key/section/FAQ/keyword parity with
    English, placeholder parity, and untranslated-English-fallback detection.
  • rules/20-i18n-and-user-facing-messages.md now lists it, so the next
    person adding a long-form content cluster (the rule calls out
    public-comparison-content/ as the next candidate) knows the UI-dictionary
    tests won't catch it.

Release notes

New automated test protects the /learn explainer content across all 13
languages from silently regressing to English or losing sections in a future
edit. No product behavior changes.

What the test actually found

Running it for the first time surfaced 3 real cases where a locale kept an
English/shared string — each one investigated and resolved as a documented
judgment call
, not silently allowed:

Locale String Verdict
fr "Orchestration" Correct — identical spelling in French (the word entered English from French)
de, it "Routing" Common tech loanword in both languages' technical writing, not an obvious miss
it "best of N" (SEO keyword) Deliberate — the term a non-English searcher actually types

All three are in the test's allow-list with a comment explaining the
reasoning and an explicit note inviting a native speaker to override if they
disagree — I did not make an irreversible call on translation quality
without saying so.

Test plan

  • New test: 36/36 pass
  • npm run typecheck — 0 errors
  • npm run lint — 0 errors (4 pre-existing warnings, unrelated)
  • npm test (full suite) — green; 1 pre-existing flaky timeout
    (smart-router-add-entry-form), confirmed unrelated by passing in isolation
  • npm run build — succeeds
  • npm run knowledge:verify / knowledge:coverage / audit:check — OK

🤖 Generated with Claude Code

ihabkhaled and others added 2 commits September 1, 2026 15:54
The four existing locale-completeness tests (persian/japanese/thai/chinese)
all assert against lib/i18n/locales/*, the UI-chrome dictionary — none of
them touch constants/learn-content/*.constants.ts, the actual /learn article
prose. A manual audit found the content clean today, but nothing caught a
future regression, and ar/fr/hi/ru had no locale-specific translation test
of any kind.

Adds one parameterized test covering all 13 locales: key/section/FAQ parity
with English, placeholder parity, and an untranslated-English-fallback check
with its own documented allow-list.

Running it against real content surfaced 3 genuine judgment calls, resolved
and documented rather than silently allowed:
- "Orchestration" unchanged in French is correct — it's the same spelling in
  both languages (the word entered English from French).
- "Routing" unchanged in German/Italian eyebrows is a common tech loanword in
  both languages, not an obvious miss.
- "best of N" unchanged in an Italian SEO keyword is deliberate — it's the
  term a non-English searcher would actually type.
All three are commented in the allow-list for a native speaker to override.

Knowledge delta: rules/20 now points at this test so it isn't found only by
reading the file list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resolves the only real conflict, package-lock.json, by taking main's
version — this branch's own package.json is unaffected by main's NestJS
12 upgrade, so nothing to reconcile beyond the lockfile. The new
learn-content-locale-completeness.test.ts (36 tests) passes unchanged
against merged main.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ihabkhaled
ihabkhaled merged commit 814fd2d into main Sep 1, 2026
9 of 90 checks passed
@ihabkhaled
ihabkhaled deleted the test/learn-content-locale-completeness branch September 1, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant