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.

  1. Create account

    Go to https://www.transifex.com and, click Try it for free and enter the needed information to create your free account

    ../../_images/transifex_homepage.png
  2. 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

    ../../_images/transifex_join_project.png

    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.

  3. Wait for permission to update translations from translation leader (email)

  4. Start a translation

    Click on the Translate button, then select the language where you want to add a translation

    ../../_images/transifex_start.png

    You’ll see two main translation areas: javascript and master. Choose the one you want to add a translation and you’ll see an interface like this

    ../../_images/transifex_interface.png

    Click untranslated and add your translation like shown below

    ../../_images/transifex_add_translation.png

    When you stop translating, do not forget to hit the green save button at the top right!

  5. 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.

Note

It is recommended to first create a new branch e.g. translation in your repository for your translations.

  1. 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
    
  2. Run the pre_translate.sh script to generate/merge (update) all of the .po files for each language:

    $ sh i18n/scripts/pre_translate.sh
    
  3. Do a pull from Transifex to get latest translations:

    $ tx pull -a
    
  4. 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
    
  5. 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
    
  6. Now make a pull request and GeoNode will push your changes to Transifex and include them in its official repository.

Only for transifex maintainers

Note

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.

../../_images/transifex_request_language.png