Skip to content

fix(i18n): synchronize locale plural forms - #1390

Merged
CyberTimon merged 3 commits into
CyberTimon:mainfrom
VailElla:codex/i18n-plural-sync
Jul 18, 2026
Merged

fix(i18n): synchronize locale plural forms#1390
CyberTimon merged 3 commits into
CyberTimon:mainfrom
VailElla:codex/i18n-plural-sync

Conversation

@VailElla

@VailElla VailElla commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Include the already shipped Korean locale in the i18next CLI locale set.
  • Synchronize generated plural variants across all shipped locales.
  • Populate generated variants with non-empty same-locale text; where no dedicated grammatical form already existed, reuse the locale's existing generic or base phrasing.
  • Set returnEmptyString: false as a defensive runtime fallback.
  • Add scripts/check-i18n-runtime.mjs and run it from npm 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.PluralRules category 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 current main at 117 existing diagnostics.

  • npm run i18n:lint — matches current main at 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 main at 026a78f7: branch head 0617b400 matches the PR head; production build, diff check, runtime i18n validation, targeted ESLint, and Prettier passed; typecheck remains equal to the 117-diagnostic main baseline.

Test Configuration:

  • OS: macOS 26.5.2
  • Hardware: Apple M4 Pro (arm64)

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

This PR should land before #1370. The two PRs overlap mechanically in i18next.config.ts and locale JSON files but have no behavioral dependency; #1370 should rebase after this PR merges.

AI Disclaimer:

  • This PR is entirely AI-generated
  • This PR is AI-generated but guided by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

@VailElla
VailElla marked this pull request as ready for review July 17, 2026 15:09
@VailElla
VailElla requested a review from CyberTimon as a code owner July 17, 2026 15:09
@CyberTimon

Copy link
Copy Markdown
Owner

Excellent PR! Is it possible to move the script into src/i18n to not bloat the root directory with folders?

@CyberTimon

Copy link
Copy Markdown
Owner

Amazing, thanks so much for the quick fix! LGTM

@CyberTimon
CyberTimon merged commit 41d92c8 into CyberTimon:main Jul 18, 2026
12 checks passed
@VailElla

Copy link
Copy Markdown
Contributor Author

Thank you! Glad the updated placement works, and I really appreciate the quick review and merge.

@VailElla
VailElla deleted the codex/i18n-plural-sync branch July 22, 2026 16:43
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.

2 participants