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 i18n.rst, add list-translators to i18n_tool.py #4493

Merged
merged 3 commits into from Jun 4, 2019

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.
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-io
Copy link

codecov-io commented May 31, 2019

Codecov Report

Merging #4493 into develop will decrease coverage by 0.59%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
securedrop/securedrop/i18n_tool.py 84.18% <0%> (-10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52ae022...1625306. Read the comment docs.

@@ -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():
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@kushaldas kushaldas left a 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``.
Copy link
Contributor

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.)

Copy link
Contributor Author

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?

@kushaldas kushaldas merged commit ef1ecd7 into freedomofpress:develop Jun 4, 2019
SecureDrop Team Board automation moved this from Ready for review to Done Jun 4, 2019
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.

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