Skip to content

fix: a missing namespaced i18nKey falls back to English, not the bare key - #46

Merged
hseshadr merged 2 commits into
mainfrom
fix/namespaced-key-miss
Oct 15, 2026
Merged

hseshadr merged 2 commits into
mainfrom
fix/namespaced-key-miss

Conversation

@hseshadr

Copy link
Copy Markdown
Collaborator

Claim touched: "if that key is not translated yet, it falls back to the catalog's English, so a raw key never reaches the screen" (docs/API.md).

i18next answers a missing ns:key with key, without the namespace. describe() only treated the full ns:key as a miss, so i18nKey: "errors:device.unsupported" with no translation showed device.unsupported to the user. The almamesh agent found it while wiring 0.3.0. aml-filter uses exactly this key shape, and it's only safe today because en has the key.

Evidence Result
Red first (real i18next, missing errors: key) Received: "device.unsupported", 2 failed
After fix, pnpm gate exit 0, 341 tests, 100% statements/branches/functions/lines
Existing i18nKey tests unchanged and green (override key still looked up; translated key still used)

Fix: also treat key minus its ns: prefix as a miss. A key without : behaves as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GRdR6TpVeKiz2Tr4hEGsEo

hseshadr and others added 2 commits October 15, 2026 14:46
… key

i18next answers a missing "ns:key" with "key", without the namespace.
describe() only treated the full "ns:key" as a miss, so an entry with
i18nKey "errors:device.unsupported" showed "device.unsupported" on screen
when the translation was missing. Found while wiring almamesh to 0.3.0.

Regression test uses a real i18next instance; it was red before the fix
(Received: "device.unsupported").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GRdR6TpVeKiz2Tr4hEGsEo
…e-key miss

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GRdR6TpVeKiz2Tr4hEGsEo
@hseshadr
hseshadr merged commit c0e7dab into main Oct 15, 2026
3 checks passed
@hseshadr
hseshadr deleted the fix/namespaced-key-miss branch October 15, 2026 21:48
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