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

Add localization support #61

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Conversation

rffontenelle
Copy link

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 and others added 19 commits April 18, 2021 17:47
Add Makefile targets for generating/updating POT files,
for updating PO files, and for building translated docs.
alterando para português brasileiro
desativando o gettext compact
Separando o comando em duas linhas
Atualizando para python3
Mudando o comando para gerar os aquivos .pot
os arquivos são gerados com o comando "make update-po". É preciso criar a pasta <lang> manualmente.
Aqui deve ficar sem parâmetro, assim sempre vai gerar tudo.
Acrescentada a seção Translate
@adorilson
Copy link

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.

@rffontenelle
Copy link
Author

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

* Update to support Python 3.10
* Update copyright
* Add flake8 testing
* Remove unused import
* Update copyright for 2022
* I blue it!
@rffontenelle
Copy link
Author

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

@analaura09 analaura09 mentioned this pull request Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants