python-docs-theme icon indicating copy to clipboard operation
python-docs-theme copied to clipboard

Add script for handling translations

Open rffontenelle opened this issue 1 year ago • 2 comments

This is an initial take on the enable localization initiative adding a script to ease the babel call.

Usage:

python babel_runner.py extract           # generate translations template file (.pot)
python babel_runner.py init -l pt_BR     # generate a translation file (.po) for Brazilian Portuguese
python babel_runner.py update            # update all .po files using the existing .pot; or
python babel_runner.py update -l pt_BR   # update only the pt_BR.po
python babel_runner.py compile           # compile all .po files using the existing .pot; or
python babel_runner.py compile -l pt_BR  # compile only the pt_BR.po

See #194

rffontenelle avatar Aug 01 '24 21:08 rffontenelle

@hugovk workflow job added to tests.yml. My intention is to show the script works, but we can shape it better.

rffontenelle avatar Aug 02 '24 20:08 rffontenelle

It looks like this PR hasn't had a new activity in a while, is it finished now?

Wulian233 avatar Sep 17 '24 14:09 Wulian233

In the Simplified Chinese documentation, there is an issue regarding hard-coded (edit: not hard-coded) strings such as "added in version". that cannot be translated. Can this PR solve this problem?

https://github.com/python/python-docs-zh-cn/issues/364

Wulian233 avatar Oct 27 '24 00:10 Wulian233

In the Simplified Chinese documentation, there is an issue regarding hard-coded strings such as "added in version" and "deprecated in version" etc. that cannot be translated. Can this PR solve this problem?

https://github.com/python/python-docs-zh-cn/issues/364

No, that's a Sphinx string and it is not translated to zh_CN: https://github.com/sphinx-doc/sphinx/blob/116a430caca98580c8877cf7b0ba270eae9604bf/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po#L1951

Consider contributing in https://explore.transifex.com/sphinx-doc/sphinx-1/

rffontenelle avatar Oct 27 '24 00:10 rffontenelle

A few nits, then I think we can merge this and iterate if needed, unless anyone else has any last comments?

That's all from my side. Just a few minor changes.

rffontenelle avatar Oct 28 '24 12:10 rffontenelle

It looks great! I have a question: where should we translate this theme, and how will the translation automatically sync to this repository?

Wulian233 avatar Oct 28 '24 13:10 Wulian233

@Wulian233 I mentioned that in the issue and it is yet to be defined.

Some projects coordinate translation efforts in the own forge via pull/merge requests — not optimal for the translators. There is also translation platforms like Weblate, Transifex and others.

My vote would be to use Weblate, which provides "libre hosting" for free software and features automatic opening and updating pull request for contributed translations. Tasks involve: setting up Weblate project (I can help with/do it), maintainers here update POT and give time before releasing to receive translations; and merging translation pull requests from Weblate.

rffontenelle avatar Oct 28 '24 13:10 rffontenelle