How to contribute to GeoNode’s translation¶
Everyone is welcome to contribute to the GeoNode’s translation. There are two different ways to translate the GeoNode user interface: you can use the Transifex web application or you can edit the translation files on your local machine using Git and send Pull Requests (PR) to the GeoNode repository.
Edit translations using Transifex¶
The first workflow for contributing to GeoNode’s translation is by using Transifex. In this step you will see how to update the translations directly on the Transifex website.
Go to https://www.transifex.com and, click Try it for free and enter the needed information to create your free account
Join our project
After activating the link you’ve got in your email, you will be asked whether you want to start a new project or to join an existing project
Click join an existing project and type geonode into the search bar. Select the GeoNode project from the GeoNode organization (not the other ones!). You will be directed to the GeoNode project site on transifex. To join the team, click on the Join team button, then click on the language you want to add a translation in.
Wait for permission to update translations from translation leader (email)
Start a translation
Click on the Translate button, then select the language where you want to add a translation
Click untranslated and add your translation like shown below
When you stop translating, do not forget to hit the green save button at the top right!
See the strings translated in GeoNode
In order to see the strings translated in your GeoNode instance, you will need to synchronize your GeoNode instance with what it is in Transifex. For this purpose the best workflow it is to wait that a Transifex maintainer (see below section) will pull the files from Transifex, run the makemessages and compilemessages and finally send a PR to the GeoNode official repository. Or you can follow the following step, which uses github and does not require the help from a Transifex maintainer.
Translate on local machine from github¶
The second workflow for contributing to GeoNode’s translation is by translating the files on your local machine and send the translation to the GeoNode official repository in GitHub with pull requests.
Using this option it is assumed that you have a local Geonode GitHub repository forked.
It is recommended to first create a new branch e.g. translation in your repository for your translations.
As a first step, generate all of the needed .pot files (any time the master documentation changes):
$ cd docs $ sphinx-build -b gettext . i18n/pot
Run the pre_translate.sh script to generate/merge (update) all of the .po files for each language:
$ sh i18n/scripts/pre_translate.sh
Do a pull from Transifex to get latest translations:
$ tx pull -a
Now edit the .po files you need, make the translations and then run the post_translate.sh script:
$ vi i18n/it/LC_MESSAGES/index.po $ sh i18n/scripts/post_translate.sh
Now you have to push the changed .po files and the appropriate .pot file (can be found in geonode/docs/i18n/pot) to your remote repository using:
$ git commit $ git push
Now make a pull request and GeoNode will push your changes to Transifex and include them in its official repository.
Only for transifex maintainers¶
This section is only for the maintainers of a transifex group!
For main Geonode localization files¶
These files are generated using standard django-admin tools : makemessages and compilemessages command line tools.
At first make sure to install Transifex client and configure your .transifexrc with our credentials as:
[https://www.transifex.com] username = YOURUSERNAME token = password = PUTYOURPW hostname = https://www.transifex.com
To prepare the PR in your branch, execute following steps. First go to the [yourpath]/geonode/geonode/ subdirectory and get all translations from transifex.com and force their replacement:
$ tx pull -a -s -f
Then update the messages in the po and compile the corresponding mo:
$ geonode makemessages --all $ geonode makemessages -d djangojs --all $ geonode compiliemessages
Now you can send the PR to GeoNode GitHub repository.
Finally update resources on transifex.com:
$ tx push -s -t
How to add a new language¶
To add a new language, click on Request language on the right top of the Transifex webpage.