Repository navigation
Conversation
schizophrenicmaniac
requested review from
aminghadersohi,
betodealmeida,
dpgaspar,
eschutho,
geido,
hainenber,
kgabryje,
mistercrunch,
msyavuz,
nytai,
rusackas,
sadpandajoe,
sha174n and
villebro
as code owners
November 18, 2026 17:00
Contributor
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
One edge case in the literal-percent check, inline.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46320 +/- ##
==========================================
+ Coverage 86.04% 86.05% +0.01%
==========================================
Files 3138 3138
Lines 218690 218858 +168
Branches 51771 51799 +28
==========================================
+ Hits 188166 188335 +169
+ Misses 27096 27094 -2
- Partials 3428 3429 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rusackas
approved these changes
Nov 24, 2026
rusackas
left a comment
Member
There was a problem hiding this comment.
Thanks @schizophrenicmaniac, LGTM! Nice to see the hardcoded list go away in favor of one shared check.
rusackas
force-pushed
the
fix/46304-incorrect-labels-in-pot-files
branch
from
November 25, 2026 01:37
55eead8 to
cbd3318
Compare
…ce the rebase Run scripts/translations/literal_percent.py over the catalogs so the committed-catalog guard passes against current master. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
rusackas
force-pushed
the
fix/46304-incorrect-labels-in-pot-files
branch
from
November 26, 2026 17:06
cbd3318 to
1c41e78
Compare
5 tasks
9 tasks
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.
SUMMARY
Babel marks a message
python-formatwhenever the msgid contains something that looks like a %-directive. Labels such as "% of row total" match by accident:% oreads as a space flag plus theoconversion. Nothing ever %-formats these strings, but msgfmt then rejects translations that don't reproduce the fake directive. babel_update.sh andnormalize_catalog()in backfill_po.py both cleared the flag, but only for a hardcoded list of three labels ("% calculation", "% of parent", "% of total"), so every label added later ("% of", "% of column", "% of column total", "% of grand total", "% of row total") and the three conditional-formatting tooltips that mention "% of column" kept the wrong flag.This replaces the list with one check in a small new script, scripts/translations/literal_percent.py. A message counts as literal when every directive Babel finds is a
%followed by a space and a word. Anything with a real placeholder (%(name)s,%s) keeps its flag. babel_update.sh runs the script afterpybabel update, where the old heredoc ran, and backfill_po.py imports the same function, so the two places can't drift apart again. The script rewrites only the#,flag lines. It reads msgids wrapped over several lines, so the long tooltips in the 76-column .po files are covered as well.I also ran it over messages.pot and all language catalogs. The only changes are the flag lines of the 5 labels and 3 tooltips from the issue, with existing
fuzzyflags kept."Contains text (ILIKE %x%)" and "Ends with (ILIKE %x)" are also flagged python-format, but
%xis a real directive shape and not the "% of" pattern, so I left them out of this PR.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable, no UI change.
TESTING INSTRUCTIONS
pytest tests/unit_tests/scripts/translations/literal_percent_test.py tests/unit_tests/scripts/translations/backfill_po_test.py tests/unit_tests/scripts/translations/babel_update_test.pygrep -n -B1 'msgid "% of' superset/translations/messages.potshows#, no-python-formaton every "% of ..." label.python scripts/translations/literal_percent.pyon this branch changes nothing. On master it fixes the entries listed in the issue.msgfmt -c -o /dev/null superset/translations/fr/LC_MESSAGES/messages.pono longer reports format mismatches for these entries once they have translations.ADDITIONAL INFORMATION