ci: add .pot freshness and .mo compilation checks#893
Open
Krupakar-Reddy-S wants to merge 2 commits intoSeedSigner:devfrom
Open
ci: add .pot freshness and .mo compilation checks#893Krupakar-Reddy-S wants to merge 2 commits intoSeedSigner:devfrom
Krupakar-Reddy-S wants to merge 2 commits intoSeedSigner:devfrom
Conversation
18 tasks
|
LGTM. I pulled this branch locally and validated the pot-freshness behavior by changing a translatable UI string without regenerating messages.pot. The check correctly ignored POT-Creation-Date noise, detected the real diff, and failed with a clear, actionable error. Great CI improvement. Minor cross-platform note (non-blocking): the current |
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
Problem or Issue being addressed
Two localization CI gaps called out as explicit TODOs in
l10n/README.md:Line 272: "Github Action to auto-generate messages.pot and fail a PR update if out of date" — a contributor can add or change translatable strings (
_(),_mft(),ButtonOption()) and forget to regeneratemessages.pot. Translators on Transifex never see the new strings until someone notices manually.Line 304: *"Github Actions automation to regenerate/verify that *.mo files have been updated after .po changes" — currently there is no CI check that catches stale or broken
.mofiles in the translations submodule.Solution
Adds two new CI jobs to
tests.yml:pot-freshness— Copies the existingmessages.pot, re-runspython setup.py extract_messages, strips thePOT-Creation-Datetimestamp from both files (Babel always writes the current time, which would cause a false diff), and diffs the two. Fails with a clear::error::message if the content changed.mo-compilation— Runspython setup.py compile_catalogto recompile all.mofiles from their.posources, then diffs inside the translations submodule. Emits a::warning::annotation if any.mofile changed. Currently warns but does not fail, sincecaandnlhave stale.mofiles at the pinned submodule commit. A TODO comment marks where to flip toexit 1once the submodule is fixed.Both jobs run independently of the
testmatrix and only need Babel, so they are lightweight and fast.Also creates
CONTRIBUTING.mdwith a localization section explaining when and how to runextract_messageslocally. No existing contributing guide was found in the repo.Note: the translations submodule is moving toward not committing
.mofiles at all (commit76c6f57removed them,.gitignoreexcludes*.mo). Once the main repo bumps its submodule pointer past that commit, the mo-compilation check becomes a "doescompile_catalogsucceed" validation — still useful for catching malformed.pofiles.Additional Information
Verified locally three ways:
python setup.py extract_messages+ timestamp-stripped diff: no false positivesdocker compose run): both checks pass/warn as expectedact: jobs succeed end-to-endScreenshots
N/A — CI workflow changes, no UI modifications.
This pull request is categorized as a:
Checklist
I ran
pytestlocallyI included screenshots of any new or modified screens
Should be part of the PR description above.
I added or updated tests
Any new or altered functionality should be covered in a unit test. Any new or updated sequences require FlowTests.
I tested this PR hands-on on the following platform(s):
I have reviewed these notes:
Thank you! Please join our Devs' Telegram group to get more involved.