-
Notifications
You must be signed in to change notification settings - Fork 689
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
feat: update all languages in Weblate, but only offer supported ones in securedrop-admin sdconfig
#6557
Conversation
update_from_weblate() now stages changes (a) for all locales updated from the securedrop/securedrop component but (b) for only supported locales updated from the securedrop/desktop component, since this link is defined explicitly in the I18N_CONF file. commit_changes(), which is called only from update_from_weblate(), now takes a list of paths to check for staged changes and returns if "git commit" would be a no-op.
Existing tests check for the availability of the de_DE, es_ES, and fr_FR locales, so we mark them as "supported_locales". Some tests need to be passed "tmpdir" in order to instantiate a fully-parameterized SiteConfig.
dc64ca5
to
01ba0bd
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.
Took my time with this one because I had no prior experience with our i18n/l10n infrastructure. Happy to report that the test plan checks out, and the changes seem like a good pragmatic next step to improve admin-facing and developer-facing systems. Thanks @cfm!
After freedomofpress/securedrop#6557, in lieu of a Venn diagram.
After freedomofpress/securedrop#6557, in lieu of a Venn diagram. I regret that I did not manage to use identical terminology between freedomofpress/securedrop#6406 and freedomofpress/securedrop#6557.
Looks like Arabic didn't make it into i18n.json. Was that by design or an oversight? |
After freedomofpress/securedrop#6557, in lieu of a Venn diagram. I regret that I did not manage to use identical terminology between freedomofpress/securedrop#6406 and freedomofpress/securedrop#6557.
Status
Ready for review
Description of Changes
Towards #6156, which (with these changes) should be completed automatically as part of the v2.5.0 localization cycle.
Closes #6387 by:
securedrop/i18n.json
;i18n_tool.py update-from-weblate
to pull translations for all locales available for translation in Weblate; thereby alsoi18n_tool.py translate-{messages,desktop}
to update source strings for all locales available for translation in Weblate; whilesecuredrop-admin sdconfig
to allow administrators to select only those languages both present (in thesecuredrop
repository) and supported (ini18n.json
).Testing
securedrop-admin sdconfig
This is the higher priority for testing, since it is an administrator-facing change.
6387-supported-languages
.securedrop-admin sdconfig
and attempt to enable a nonexistent locale (e.g.,foo
).securedrop-admin sdconfig
and attempt to enable any two or more supported locales (e.g.,en_US de_DE ro
).securedrop/translations
. Then runsecuredrop-admin sdconfig
.supported_locales
entry insecuredrop/i18n.json
. Then runsecuredrop-admin sdonfig
.i18n_tool.py
This is the lower priority for testing, since it's a tooling change we can tweak in place if necessary, including during the localization cycle.
Run
securedrop/i18n_tool.py update-from-weblate
.An
INFO
is logged to the standard output for each unsupported language like:securedrop/securedrop/i18n_tool.py
Lines 327 to 328 in efdc952
Changes to all languages, not only supported ones, are fetched, checked out, staged, and committed.
Deployment
These changes should be invisible to the administrators of any correctly-configured SecureDrop instance. If (e.g.) an instance has custom translations installed, these will be unavailable after the next
securedrop-admin sdconfig
. If in the future we drop support for a language we currently support, administrators will have to update their configured locales on their nextsecuredrop-admin sdconfig
.Checklist
If you made changes to the server application code:
make lint
) and tests (make test
) pass in the development containerIf you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made non-trivial code changes:
Choose one of the following:
Documentation will follow from me and/or @eaon as Localization Managers for the v2.5.0 release.