You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the browser i18n runtime look up profile names and message ids as own keys #701
The browser i18n runtime looks up format profiles and message ids by plain object index on objects made by JSON.parse:
profile() in packages/js/citry-client/src/citry-i18n-runtime.ts:448-452: category?.[name]
the Fluent NUMBER profile check, citry-i18n-runtime.ts:894
message lookups, citry-i18n-runtime.ts:990 and packages/js/citry-client/src/citry-i18n-core.ts:224
So a profile name __proto__ finds Object.prototype instead of failing: format.number(1, {format: "__proto__"}) formats with default options, while docs_site/content/i18n/formatting.md says an unknown profile name raises. A message id __proto__ or constructor fails with I18N_ARTIFACT_INVALID instead of I18N_MESSAGE_MISSING.
The effect is wrong output or a wrong error code; no markup or code is involved. Locale names and State names already use Maps or null-prototype objects with own-key checks.
Fix
Look these names up with an own-property check (Object.hasOwn), or copy the tables into Maps, so a name reaches only its own entry (CLAUDE.md Mechanism 7).
Found while writing the trust-boundary design doc for #603.
changed the title [-]Look up i18n format profiles and message ids by own key in the browser[/-][+]Make the browser i18n runtime look up profile names and message ids as own keys[/+]on Nov 15, 2026
Activity
[-]Look up i18n format profiles and message ids by own key in the browser[/-][+]Make the browser i18n runtime look up profile names and message ids as own keys[/+]