Repository navigation
FIX: Select RandomTranslationConverter languages in the same order as its identifier - #3784
Merged
Roman Lutz (romanlutz) merged 1 commit intoNov 4, 2026
Conversation
This was referenced Nov 2, 2026
Roman Lutz (romanlutz)
approved these changes
Nov 4, 2026
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
Fixes #3717.
RandomTranslationConverter._build_identifieralready sorts the language pool case-insensitively, butconvert_word_asyncpicked fromself.languagesin the order the caller passed it. With the same seed,["Spanish", "French"]and["French", "Spanish"]had equal identifier hashes but chose different languages, so the identity did not describe the seeded behavior.self.languagesis now stored in that same sorted order at construction, for both custom and default pools. Selection and identity now agree, and identifier hashes are unchanged. One side effect worth noting: for a given seed, the language picked for each word can differ from before this change whenever the pool was not already in sorted order.Tests and Documentation
Added
test_random_translation_converter_language_order_does_not_change_seeded_choicestotests/unit/converter/test_random_translation_converter.py. With a configured root seed, two converters whose language lists differ only in order now send the same request to the target and have the same identifier hash. On main the hashes match but the requests differ.No docs or notebooks changed, so JupyText was not needed.