Repository navigation
Fix catalog updates using the locale plural form count - #1471
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
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.
Fixes #1470.
When a singular message becomes plural,
Catalog.update()creates two translations regardless of the target locale. Russian catalogs therefore get two forms instead of three, and Japanese catalogs get two instead of one. Updating an existing plural message with an outdated form count also leaves that count unchanged.Size both paths to
catalog.num_plurals, retaining translations that fit, padding missing forms with empty strings, and marking changed messages fuzzy. Regression tests cover one-form and three-form locales, resizing existing translations, and preserving valid messages.Validation: all 8,225 tests pass, with 3 skipped and 2 expected failures; Ruff and
git diff --checkpass. Four new regression cases fail before the fix.AI assistance: OpenAI Codex assisted with the investigation, patch, tests, and description. The reproduction and checks were executed locally.