Repository navigation
Fix i18n check: context keys (Light|theme) are not plural forms - #540
Merged
Merged
Conversation
Contributor
Author
|
Thanks for building on this, @Xarishark — the I ran the updated checker against the completed Vietnamese translation in #539: |
Xarishark
approved these changes
Nov 25, 2026
Xarishark
left a comment
Collaborator
There was a problem hiding this comment.
All notes resolved and CI passed. Approving.
1 task done
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.
Problem
tools/launcher-i18n.py --checkreports a false positive for the context keyLight|themein all 22 language files:Light|themeis not a plural form and not a coded message. It is a context key used throughtc()inui/app.js:181:The part after
|is a context hint for translators; the translation is a single form (e.g. deHell, frClair, viSáng). Giving it two forms would print a literal|on the button. Butcheck()applied the plural-style rule to every key containing|:Fix
One line: only apply the
|rule when the key really is a coded message — i.e. its prefix is an ALL-CAPS code token and the translation preserves that prefix:The two real coded messages,
PICK_EXE|...andNEED_COPY|...(emitted fromsrc-tauri/src/lib.rs), keep the old behaviour: their translations keep the code prefix and the two-part structure, and they still pass in every language.Note the prefix check alone is not enough: en-GB translates
Light|themeasLight, whose first segment equals the source's, so it was still flagged. The.isupper()code-token test separates the two cases (there are exactly three|keys in the corpus:Light|theme,PICK_EXE|...,NEED_COPY|...).Verification
python3 tools/launcher-i18n.py --checkbefore / after:Light|themefalse positives removed)Light|themeerrors: 22 → 0PICK_EXE/NEED_COPYerrors: 0 → 0 (unaffected)No translation files are changed.
🤖 Fixed with AI assistance (Fable 5.2) and reviewed by the author.