-
Notifications
You must be signed in to change notification settings - Fork 690
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 i18n.rst, add list-translators to i18n_tool.py #4493
Conversation
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.
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 freedomofpress#4441.
Codecov Report
@@ Coverage Diff @@
## develop #4493 +/- ##
==========================================
- Coverage 83.21% 82.62% -0.6%
==========================================
Files 45 45
Lines 3069 3114 +45
Branches 332 337 +5
==========================================
+ Hits 2554 2573 +19
- Misses 430 456 +26
Partials 85 85
Continue to review full report at Codecov.
|
@@ -201,15 +202,15 @@ def require_git_email_name(git_dir): | |||
'git -C {d} config --get user.email > /dev/null'.format( | |||
d=git_dir)) | |||
if subprocess.call(cmd, shell=True): # nosec | |||
if six.u('docker') in io.open('/proc/1/cgroup').read(): |
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.
Any particular reason to remove the usage of six
?
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.
Yes. This PR includes changes from #4482 where that change is explained. Sorry for not documenting it here too:
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.
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.
One small change is required, otherwise this is approved. 🦄
|
||
securedrop/bin/dev-shell ./i18n_tool.py --verbose translate-desktop --compile | ||
* Click ``Commit``. | ||
* Click ``Push``. |
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.
@rmol I would love to keep the text from last PR on this (as in develop).
* Click ``Push`` (we do these two steps, so that uncommitted changes
in the repo do not create merge conflicts.)
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 moved the explanation before the two steps, just above. Do you want this in addition to that, or do you mean you'd prefer that it just be explained here?
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 toi18n_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 withmake -C securedrop list-translators
andmake -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:
If you made changes to documentation:
make docs-lint
) passed locally