- How you use it
- You ask for it
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0Check JSON catalogs before fallback |
|---|---|
| How you use it | You ask for it |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
Gate localization on catalog completeness and ICU validity, then run pseudo-locales and per-locale browser checks including real Arabic in RTL.
What changed
- Current FormatJS CLI docs, checked 2026-10-28, describe message verification and AST-based pseudo-locales; translating raw ICU strings character by character is unsafe.
- Current Lingui CLI docs, checked 2026-10-28, distinguish fallback-resolved missing messages from catalog-level missing messages. Pick the gate that matches whether fallback is acceptable for release.
How to build the QA workflow
1. Inventory locales, namespaces, source catalogs, fallback rules, dynamic keys, rich-text tags and critical routes. Give the agent a route/state/locale matrix covering forms, errors, loading, empty states and long content. Include default locale, a long-text locale, a pseudo-locale and real Arabic; expand critical flows to every supported locale. 2. Check catalogs before runtime fallback. For JSON, flatten nested object leaves consistently, compare source and target key sets per namespace, and reject missing/empty required values. Keep an explicit exception list for intentional omissions. Distinguish an unused source key from a missing target key; static scanners cannot discover every dynamically composed key. 3. Use the stack's native parser. For compatible ICU JSON catalogs, the documented command is formatjs verify 'lang/*.json' --source-locale en --missing-keys --structural-equality. Source en.json must be included. Compile each catalog too, using its actual format; formatjs compile lang/ar.json --format simple --ast --out-file build/ar.json assumes plain message strings. A project can prefix these with pnpm exec when the CLI is installed locally. Structural checks and syntax checks catch different errors. Do not apply ICU rules blindly to i18next interpolation or Lingui PO catalogs. 4. On Lingui, run lingui check sync and lingui check missing --mode catalog to reject incomplete catalogs before fallbacks, then the project's compile step. The default missing check uses fallback resolution. For other runtimes, implement equivalent catalog-level checks rather than assuming a runtime missing-key hook covers every locale. 5. Generate pseudo-locales without modifying argument names, plural syntax or rich-text tags. FormatJS documents formatjs compile lang/en.json --format simple --ast --pseudo-locale en-XA --out-file build/en-XA.json; --ast is required. Integrate the output only with a runtime that accepts that AST. For Lingui, follow its native pseudolocalization guide, checked 2026-10-28. Do not replace production catalogs with test catalogs. 6. Define Playwright projects for the locale matrix. Set browser locale and separately select the app's locale route/cookie; changing browser locale alone does not prove translated UI loaded. Set deterministic content, timezone, fonts and viewport, then visit the same states. Keep expected screenshots separated by locale/project; use await expect(page).toHaveScreenshot('checkout.png') from the visual comparison guide, checked 2026-10-28. Review new baselines rather than bulk-accepting differences. 7. For Arabic, assert the rendered root has the intended lang and dir, then inspect clipped text, focus order, menus, directional icons, punctuation, emails, SKU codes, numbers and mixed text. W3C bidi guidance, checked 2026-10-28, recommends isolation for inserted opposite-direction text. Use real Arabic content and a fluent reviewer; pseudo-RTL is only a stress test. 8. In CI, fail catalog/syntax checks first, then run browser tests and attach locale-named screenshots/diffs. Triage a failure to catalog, formatting, layout or language quality before asking the agent to edit. Require human approval for baseline changes and translated meaning.
Versions and licences
Official repository manifest snapshots, checked 2026-11-24; pin tools compatible with the app rather than treating these as registry dist-tags.
| Tool | Snapshot and licence | Source |
|---|---|---|
| @formatjs/cli | As of November 2026, 6.23.0; MIT; checked 2026-11-24 | Official manifest |
| @lingui/core | As of November 2026, 6.12.0; MIT; checked 2026-11-24 | Official manifest |
When to pick which
| Check | Use when | Not for |
|---|---|---|
| Catalog comparison | Every locale must supply every required key | Proving translation meaning or grammar |
| ICU parse/structural validation | Your runtime consumes ICU messages | Comparing arbitrary interpolation formats as if they were ICU |
| Pseudo-locales | Finding unextracted text, clipping and fragile layout | Certifying Arabic wording or script shaping |
| Per-locale screenshots and interaction tests | Finding visual and behavioural regressions | Automatically approving every visual difference |
What breaks
Fallback can make a page look complete while target catalogs are incomplete. Broken placeholders can fail only in plural branches. Screenshots can look correct while accessible names, focus behaviour or validation errors remain untranslated. Pseudo-expansion exposes fixed-width controls but does not cover all real language behaviour.
What to test
Exercise counts including zero, one, two and larger values through the runtime's locale plural rules, interpolation, rich text, dates and currencies. Seed a missing target key and malformed ICU message to prove both gates fail. Inspect desktop/mobile and zoomed layouts, toast/dialog/error states and form labels. Record screenshots for each locale and verify the app actually selected that locale.
Community evidence
- In i18next issue 2220, danikaze reports that a key resolved through the fallback language does not trigger the expected missing-key notification. This motivates a separate catalog gate; it is not a claim about every runtime's event behaviour.
- In FormatJS issue 2165, AustinBratcher describes naive pseudo-localization removing rich-text structure or placeholders. The current official CLI is the command reference; the older issue supplies the failure case.
Pitfalls
Do not accent ICU syntax, disable fallback globally in production to make tests easier, accept all screenshots automatically, or equate identical key counts with identical key sets. Font/rendering differences need stable browser environments. Testing only the homepage misses many untranslated states.
A prompt for your agent
Your training data may predate these CLIs. Read the linked official FormatJS, Lingui and Playwright pages before writing commands; do not guess flags. Inspect our real message format and fallback policy. Add catalog and syntax gates, safe pseudo-locales and locale/state screenshot projects. Prove the gates reject deliberate fixture defects, identify untranslated accessible labels, and give an Arabic reviewer a focused RTL checklist. Do not approve translations or new visual baselines yourself.
Limits
No catalogs, browser tests or Arabic review were run. Evidence demonstrates individual failure modes, not a measured reduction in localization defects. Automated checks cannot establish linguistic accuracy, cultural appropriateness or complete assistive-technology support.
Started from a post by @danikaze, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.