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

Update Internationalization docs and add translator list function to i18n_tool.py #4492

Closed
wants to merge 3 commits into from

Conversation

rmol
Copy link
Contributor

@rmol rmol commented May 31, 2019

Status

Ready for review

Description of Changes

Restructured the Internationalization docs (docs/development/i18n.rst) to make the order of operations clearer for developers and localization managers. Updated the process now that string and feature freeze are synchronized.

Added a list-translators function to i18n_tool.py to simplify translator attribution at release time.

Fixes #4441.

Testing

Run make docs, navigate to http://localhost:8000/development/i18n.html and read critically.

Test the i18n_tools.py changes with make -C securedrop list-translators and make -C securedrop list-all-translators.

Deployment

This is pretty much dev-only and shouldn't affect deployment, as the changes to i18n_tool.py didn't involve compilation.

Checklist

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

If you made changes to documentation:

  • Doc linting (make docs-lint) passed locally

rmol added 3 commits May 30, 2019 13:40
Use of six.u was corrupting translator names. According to
https://pythonhosted.org/six/index.html#six.u -- "On Python 2, u()
doesn't know what the encoding of the literal is. Each byte is
converted directly to the unicode codepoint of the same value. Because
of this, it's only safe to use u() with strings of ASCII data."

Of course some translators' names were not just ASCII, so I've
replaced usage of six.u with u"", as it should be safe on both Python
2 and Python 3 > 3.3, per PEP-0414.

I also changed the commit format to put each contributor's name on its
own line, and tried to clarify the source of the translations. It was
confusing to me, at least, that translations were being "copied from"
a revision that involved a different language.

Finally, we were gathering the list of contributors from commits other
than just the Weblate contributions, so whoever last ran the tool was
getting credited for translations since. I've changed the tool to only
look for contributors in the automated Weblate commits.
@eloquence
Copy link
Member

(Since this includes code changes to the tool, should the branch have the docs- prefix?)

The flake8 fail appears to be real:

./securedrop/i18n_tool.py:5:1: F401 'collections' imported but unused
./securedrop/i18n_tool.py:421:17: E722 do not use bare except'

@eloquence eloquence changed the title Update Internationalization docs Update Internationalization docs and add translator list function to i18n_tool.py May 31, 2019
@rmol
Copy link
Contributor Author

rmol commented May 31, 2019

Shoot, didn't think about the docs- handling in CI. I'll close this and reopen with a better branch name.

@rmol rmol closed this May 31, 2019
@rmol rmol deleted the docs-i18n-4441 branch May 31, 2019 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update localization management guide for recent changes to string freeze
2 participants