Skip to content
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

provides tooling for interactive localization updates #1348

Merged
merged 9 commits into from Dec 7, 2021

Conversation

cfm
Copy link
Member

@cfm cfm commented Nov 23, 2021

Description

Closes #1317 by:

  1. removing the l10n GitHub Actions workflow added in mechanizes continuous-localization workflow #1282;
  2. renaming the Make targets extract-strings and check-strings for clarity;
  3. using check-strings in CI to "lint" that the translation catalog has been updated via extract-strings;
  4. offering a Git pre-commit hook for check-strings configurable with make hooks; and
  5. removing Make targets whose functions can be performed by Weblate add-ons without custom code or tooling.

Step (5) is this pull request's addition over "option A" #1347.

How to think about this pull request

The following gist offers background considerations shared with, and for evaluating this "option B" pull request against, "option A" #1347:

https://gist.github.com/cfm/d3173206f55d7e44152928fcfd215031

Test Plan

To test the developer experience

  1. Change a _()-wrapped source string and commit it
  2. Push to testing branch like 1348-cfm-testing (where cfm is your GitHub username ;-)
  3. Confirm that test-buster fails on make check-strings with the following error message:

    Translation catalog is out of date. Please run "make extract-strings" and commit the changes.

  4. Run make hooks (or rerun make venv or your platform-appropriate variant)
  5. Try to git commit --all and confirm that the pre-commit hook fails on make check-strings as above
  6. Run make extract-strings
  7. Retry git commit --all and confirm that the commit succeeds
  8. Push to your testing branch
  9. Confirm that test-buster passes

To test the Weblate features

  1. Ask @cfm to add you as a collaborator on cfm/securedrop-client
  2. git remote add cfm git@github.com:cfm/securedrop-client.git
  3. git push -f cfm 1348-cfm-testing^:i18n-testing (where 1348-cfm-testing is the testing branch you used above), to push your string change before make extract-strings
  4. Reset Weblate from cfm/securedrop-client: https://weblate-sandbox.securedrop.org/projects/securedrop/securedrop-client/#repository
  5. Explore Weblate and the pull request it maintains in cfm/securedrop-client
  6. git push cfm 1348-cfm-testing:i18n-testing (where 1348-cfm-testing is the testing branch you used above), to push your string change with make extract-strings
  7. Update Weblate from cfm/securedrop-client: https://weblate-sandbox.securedrop.org/projects/securedrop/securedrop-client/#repository
  8. Continue exploring Weblate and cfm/securedrop-client
    1. Translate the string you changed
    2. Push from Weblate: https://weblate-sandbox.securedrop.org/projects/securedrop/securedrop-client/#repository

Checklist

Before merge

After merge

  • Replicate add-on configuration for the securedrop-client Weblate component from weblate-sandbox to weblate:

image

For review

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:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

@cfm cfm changed the title provides tooling for interactive localization updates (option B) provides tooling for interactive localization updates Nov 30, 2021
@cfm cfm force-pushed the 1317-option-b branch 2 times, most recently from f1386ba to 198262a Compare December 1, 2021 00:10
It appears from WeblateOrg/weblate@b965961 that ".mo" files must already
be present in the repository for the weblate.gettext.mo add-on to keep
them current.
@cfm cfm marked this pull request as ready for review December 1, 2021 00:17
@cfm cfm requested a review from a team as a code owner December 1, 2021 00:17
@cfm
Copy link
Member Author

cfm commented Dec 1, 2021

@creviera, this is ready for your review per #1317 (comment) and our conversation this morning. I've divided the test plan into separate sections for the developer experience and the Weblate workflow. The former is worth stepping through as written; but let me know if you'd like to pair on the latter, since it takes place between the Weblate sandbox and my cfm/securedrop fork to minimize noise here in the official repository.

@cfm cfm added this to Ready for Review in SecureDrop Team Board Dec 1, 2021
@cfm
Copy link
Member Author

cfm commented Dec 2, 2021

I realized today that this pull request has neglected to document the addition of make hooks. I've offered a minimal explanation in 0b6a60d and am happy to add further documentation in response to review feedback.

sssoleileraaa pushed a commit that referenced this pull request Dec 2, 2021
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works! exciting to see so many pieces working seamlessly together. nice work, @cfm.

@conorsch - I would merge this now, but want to err on the side of caution until the 0.5.0 release is finalized (would be nice to fix up our release workflow one day so we don't have to halt merging to the client repo during QA but that's for another time!)

@sssoleileraaa
Copy link
Contributor

(I ended up checking the boxes directly in the test plan in the PR description out of laziness- it all checked out)

@sssoleileraaa sssoleileraaa merged commit 7820a5b into main Dec 7, 2021
SecureDrop Team Board automation moved this from Ready for Review to Done Dec 7, 2021
@sssoleileraaa sssoleileraaa deleted the 1317-option-b branch December 7, 2021 17:34
@cfm
Copy link
Member Author

cfm commented Dec 7, 2021

  • Replicate add-on configuration for the securedrop-client Weblate component from weblate-sandbox to weblate:

This post-merge step is done—

image

—and https://weblate.securedrop.org/projects/securedrop/securedrop-client/ reset from freedomofpress/securedrop-client@main to begin working in the new workflow, looking for the messages.pot template updated in place.

cfm added a commit that referenced this pull request Dec 7, 2021
After #1348, setuptools is not responsible for compiling the portable to
machine objects, only for including both as produced by Weblate.
@sssoleileraaa sssoleileraaa mentioned this pull request Dec 7, 2021
2 tasks
cfm added a commit that referenced this pull request Jan 14, 2022
After #1348, setuptools is not responsible for compiling the portable to
machine objects, only for including both as produced by Weblate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

rework localization Make targets for PR-level use
2 participants