Skip to content

test(mobile): check every literal copy key exists in both locales - #157

Closed
santinofuentesAI wants to merge 1 commit into
DojoCodingLabs:mainfrom
santinofuentesAI:test/copy-keys-check
Closed

santinofuentesAI wants to merge 1 commit into
DojoCodingLabs:mainfrom
santinofuentesAI:test/copy-keys-check

Conversation

@santinofuentesAI

Copy link
Copy Markdown
Contributor

What and why

Closes #29

Adds apps/mobile/src/copy-keys.ts (copyKeys(source)) using KEY_PATTERN from @hermit/copy, plus apps/mobile/src/copy-keys.test.ts to verify that every literal copy key referenced in apps/mobile/src and packages/*/src (excluding *.test.ts / *.test.tsx) exists in both packages/copy/locales/en.json and es-419.json.

  • Skips template strings with ${...} interpolations and non-key strings.
  • Checked locally by temporarily introducing a typo (HM-SET-08.tltle) in apps/mobile/src/app/about.tsx: the test failed naming the file, both locales, and the misspelled key, before reverting the typo.

Vision fit

Serves Principle 5 ("Spanish and English, first-class") and Principle 7 ("Small, typed and tested"): prevents misspelled copy keys from throwing at runtime on any screen.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: #

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --base origin/main --patterns scripts/guard/patterns.txt.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. (n/a: adds tests only; existing keys in code all resolve in both locales.)
  • Tests, fixtures and screenshots use made-up data only.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.

New dependencies and network calls

n/a

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Antigravity wrote copy-keys.ts and copy-keys.test.ts, verified the failure check on a temporary typo, ran all five gates against origin/main (6f0d47e), and drafted this PR description.
  • I read and ran everything in this pull request, and I can explain it.

…joCodingLabs#29)

Signed-off-by: Santino Fuentes <santinofuentesAI@users.noreply.github.com>
@juancguerrerodev

Copy link
Copy Markdown
Contributor

Thanks, Santino, and sorry about this one. You opened it 20 minutes before #160, but it didn't show up in the open list when I merged the queue this afternoon, so #160, which adds the same check, landed first. Closing this as a duplicate. If yours checks something #160 doesn't, open a small follow-up with just that part and I'll merge it. 🦀

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.

Add a test that every copy key in code exists in both locales

2 participants