fix(i18n): convert plural templates from ICU to i18next native format #264
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!264
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-plural-templates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The Jobs screen rendered
0 of {# of positions}}instead of0 positions— the catalog had ICU MessageFormat plural templates ({count, plural, one {# position} other {# positions}}) but the universal client uses i18next, which doesn't parse ICU MessageFormat without the i18next-icu plugin. So the template body leaked through literal after the leading{count}substitution.The ICU syntax was inherited from the API side, where
next-intlconsumed it. These keys are client-only.Fix
Convert to i18next-native plural format — separate
_one/_otherkeys with regular{count}interpolation:Same for
contributionsCount. i18next picks the right key automatically based on thecountargument.Spanish catalog (
es.json) didn't have these keys; falls back to English per ADR-0025.Test plan
pnpm -F @carol/client typecheck/test(97 passing).jqverifies the four new keys parse and resolve correctly.0 positions/1 position/N positionscorrectly.Future
If more ICU-shaped strings creep into the catalog, consider pulling in
i18next-icuto handle them uniformly across both runtimes (API uses next-intl which is ICU-native; client uses i18next which needs the plugin). For now the catalog's only ICU users were these two keys.The catalog had ICU MessageFormat plurals (`{count, plural, one {# position} other {# positions}}`) authored when the API rendered them via next-intl. The universal client uses i18next, which doesn't parse ICU MessageFormat without the i18next-icu plugin — so the literal template body leaked through to the UI ("0 of {# of positions}}" in the user-facing wording). Convert to i18next's native plural format: separate `_one` / `_other` keys per plural. i18next picks the right key based on `count` and applies the regular {count} interpolation. Closes the visible regression on the Jobs screen.📊 Test coverage
Patch coverage: no testable lines changed.
Overall (
app/,lib/,db/, excluding UI per ADR-0019):Soft thresholds per ADR-0019. Coverage is informational and does not block merge.