fix(i18n): synchronize locale plural forms - #1390
Merged
Merged
Conversation
VailElla
marked this pull request as ready for review
July 17, 2026 15:09
Owner
|
Excellent PR! Is it possible to move the script into src/i18n to not bloat the root directory with folders? |
Owner
|
Amazing, thanks so much for the quick fix! LGTM |
Contributor
Author
|
Thank you! Glad the updated placement works, and I really appreciate the quick review and merge. |
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.
Description
Keep every shipped locale synchronized with i18next plural extraction and runtime resolution. Generated empty plural variants could force a counted label to fall through to another language; this PR gives every generated variant a non-empty same-locale value and verifies the exact runtime plural key used for each locale.
Type of Change
Changes Made
returnEmptyString: falseas a defensive runtime fallback.scripts/check-i18n-runtime.mjsand run it fromnpm run i18n:check; it rejects empty translations, cross-language fallback, and resolution to the wrong plural suffix.Screenshots/Videos
Not applicable; this fixes localization resolution rather than layout.
Testing
I have tested these changes locally and confirmed that they work as expected without issues
npm run i18n:check— passed with no generated-file drift and 952 exact plural resolutions across all 12 shipped locales.Runtime validation covers every
Intl.PluralRulescategory available to each locale and requires the requested locale, expected suffixed key, and a non-empty result.npm run build— passed; only the existing large-chunk warning remains.npm run typecheck— matches currentmainat 117 existing diagnostics.npm run i18n:lint— matches currentmainat 36 existing hardcoded-string findings.npx eslint scripts/check-i18n-runtime.mjs— passed.Changed-file Prettier check — passed.
git diff --check origin/main...HEAD— passed.Revalidated on 2026-07-18 against upstream
mainat026a78f7: branch head0617b400matches the PR head; production build, diff check, runtime i18n validation, targeted ESLint, and Prettier passed; typecheck remains equal to the 117-diagnosticmainbaseline.Test Configuration:
Checklist
Additional Notes
This PR should land before #1370. The two PRs overlap mechanically in
i18next.config.tsand locale JSON files but have no behavioral dependency; #1370 should rebase after this PR merges.AI Disclaimer: