Repository navigation
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.
The example in the support guide merges a plugin's translations into the main catalog. If the catalogs use different plural rules, that can silently return untranslated text, even when both are French.
This documents an alternative for the runtime case in #1506. Looking in the plugin first and using the main catalog as a fallback preserves the plugin's priority while letting each catalog choose its own plural index. This doesn't change
Translations.merge()or thepybabel concatbehavior discussed in #1507.I ran the examples extracted from the built HTML with a plugin MO generated by Babel 2.18.0 and a main MO generated by master (
3a7d239). For a count of 2, the merged lookup returnedticketsand the fallback lookup returnedbillets. I also checked overlapping messages, context-specific translations and missing entries.python -m sphinx -W --keep-going -b html docs <output>andpython -m pytest -q tests/test_support_translations.py tests/messages/test_mofile.pypassed on Python 3.13. I didn't run the full platform matrix.OpenAI Codex reproduced the issue, wrote and tested the examples, and drafted this PR.