free-python-games icon indicating copy to clipboard operation
free-python-games copied to clipboard

Add localization support

Open rffontenelle opened this issue 3 years ago • 3 comments

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 by make 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:

Screenshot_2021-04-18 Grade do Free Python Games — documentação Free Python Games 2 3 2

rffontenelle avatar Apr 18 '21 21:04 rffontenelle

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.

adorilson avatar Oct 09 '21 13:10 adorilson

Rebased the PR to be up-to-date with the changes on master branch.

rffontenelle avatar Oct 12 '21 22:10 rffontenelle

Rebased the PR to be up-to-date with the changes on master branch.

rffontenelle avatar Dec 14 '21 21:12 rffontenelle