Repository navigation
fix(i18n): Select plural forms by key instead of position - #2757
Open
krish-goradia wants to merge 1 commit into
Open
krish-goradia wants to merge 1 commit into
krish-goradia wants to merge 1 commit into
Conversation
Plurals were serialized with `Object.values(...).join(' | ')`, but the
runtime picks a form by position, so `{ 0, n }` returned the zero form for
a count of 1, and `{ 1, 2, n }` was read as `{ 0, 1, n }`. Objects with
only numeric keys, like `{ 404: ..., 500: ... }`, were also collapsed into
one plural message instead of nested messages.
- Serialize plurals as `one | n` or `zero | one | n`, falling back to `n`
for a missing form. Output for `{ n }`, `{ 1, n }` and `{ 0, 1, n }` is
unchanged.
- Only treat objects with an `n` key as plurals.
- Throw a clear error for plural keys other than 0, 1 and n.
Refs wxt-dev#2747
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
krish-goradia
requested review from
PatrykKuniczak,
aklinker1 and
nishu-murmu
as code owners
November 15, 2026 23:00
✅ Deploy Preview for creative-fairy-df92c4 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Manual Testing
Related Issue
One reference was from Refs #2747 (point 1)