free-python-games
free-python-games copied to clipboard
Add localization support
Add Makefile targets for generating/updating POT files, for updating PO files, and for building translated docs. See #33.
How to use:
Install dependencies (sphinx and sphinx-intl):
cd docs
pip install -r requirements-doc.txt
Then just run the desired command. E.g.:
make update-po # Update PO files for all langauges
make update-po -l pt_BR # Create/Update PO files for Brazilian Portuguese
make pot # Update POT files (PO Templates)
make html-translated # Build all translated docs only (similar to make html)
Folders:
Translation-related files are stored in docs/locale/
:
docs/locale/<name>.pot
docs/locale/<lang>/LC_MESSAGES/<name>.po
NOTE: The
<lang>/LC_MESSAGES/
is generated bymake update-po -l <lang>
, so they don't have to be created manually.
Translated docs built are stored in _builds/<lang>/<target>
(e.g. _builds/pt_BR/html), similar to English directory _builds/<target>
.
Example:
Hi, @grantjenks .
I worked together @rffontenelle and @analaura09, and this PR was updated with brazilian portuguese po files. We have a team work in pt_br translation.
Can you review and, maybe, merge this PR? So, we will can send the translation in a different PR. Or if this PR need some fix ou adjust, let we know.
Rebased the PR to be up-to-date with the changes on master
branch.
Rebased the PR to be up-to-date with the changes on master
branch.