-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mechanizes continuous-localization workflow #1282
Conversation
Re: failing |
This is thorny, as it turns out, and I regret not catching this earlier when it transitioned from "tests are flaking because of something in |
e8af45a
to
daac963
Compare
b62af0a
to
c6ad713
Compare
"from gettext import gettext as _" in a given module ignores the locale installed in securedrop.app.configure_locale_and_language(). See: https://docs.python.org/3/library/gettext.html#gettext.install
…ted in Weblate Includes some jq magic adapted from <https://stackoverflow.com/a/42428341>.
9bed725
to
15be76f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to allow members of the sd-maintainers group perms for https://weblate.securedrop.org/projects/securedrop/securedrop-client/#repository
Ah; I'd assumed that you would have more access than I. :-) I've unmarked the "SecureDrop Client" component as "restricted", which should let you access it just like the other Weblate components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cfm This lgtm. You can see the three expected commits here: weblate-fpf@9395363 and when I run the client with the selected language as Spanish, I see the username translation. Are we ready to move this from securedrop
to securedrop-client
(main...1266-continuous-l10n#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R158) and merge? Anything else you'd like to do before a merge here?
@creviera in #1282 (review):
As expected! 🎉 Thanks for running through it from start to finish.
This is done in c86325e. I've also tacked on 9d09d24 to fix a bug in my Otherwise, I think this is ready to go! I can take care of the post-merge steps in Weblate once this is in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most recent changes lgtm - tests pass locally and in ci + talked more with cfm about why we had to switch to using gettext.[bind]textdomain (see issue #1293)
Description
Closes #1266 by providing the following mechanisms for integrating with Weblate's workflow for continuous localization, contrasted below with their equivalents in
securedrop
's phased workflow. An explicit goal of #1266 is to avoid replicating the complexity ofsecuredrop
'si18n_tool.py
.securedrop
asmake update-translation-catalogs
make translate
→i18n_tool.py translate-messages
develop
main
with Weblate forkdevelop
main
make compile-translation-catalogs
i18n_tool.py translate-messages --compile
Notes:
securedrop-client
unlikesecuredrop-debian-packaging
runs CI on pull requests including from forks.weblate-fpf/securedrop-client@weblate-securedrop-securedrop-client
→freedomofpress/securedrop-client@main
only if it isn't already open.Overview
Weblate's generic continuous-localization workflow
Adapted from their documentation and Graphivz:
Workflow implemented in this pull request
Test Plan
I can also arrange (or record) a demo of the end-to-end workflow.
On
1266-continuous-l10n
(and inside the virtual environment):l10n
workflow that will run every night onmain
.https://weblate.securedrop.org/projects/securedrop/securedrop-client/#repository: Go to Maintenance and select Reset.
https://weblate.securedrop.org/projects/securedrop/securedrop-client/: Start a New Translation for
es
.Observe 2 new commits (after
1266-continuous-l10n
) inweblate-fpf/securedrop-client@weblate-securedrop-securedrop-client
.https://weblate.securedrop.org/translate/securedrop/securedrop-client/es/?q=: Search for the string
username
and suggestNombre de Usuario
.securedrop
andsecuredrop-client
, which can pollute the translation (or at least the Git history) of the former.https://weblate.securedrop.org/projects/securedrop/securedrop-client/#repository: Select Commit.
Observe 3 commits (after
1266-continuous-l10n
) inweblate-fpf/securedrop-client@weblate-securedrop-securedrop-client
.In a
securedrop-client
development environment (i.e., with the virtual environment activated):Observe that the Username label on the login screen has been translated.
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:
If these changes modify the database schema, you should include a database migration. Please check as applicable:
main
and confirmed that the migration applies cleanlymain
and would like the reviewer to do soPre-merge steps
securedrop-client
Weblate componentFIXME
insupported-languages
Make targetPost-merge steps → #1302
main
l10n
GitHub Actions workflow for successfulupdate-translation-catalogs
Known issues
securedrop_client_ci
workflow even for each new head of Weblate's fork, because it sees the source branchweblate-securedrop-securedrop-client
through the pull request opened by Weblate. (This looks to CircleCI likepull/1281
; there's no other information about the pull request available to use in filtering logic.)