How to contribute to GeoNode’s Translation

GeoNode uses Transifex to translate the webpage and code from english to any other language. To be able to contribute to the translation, you need to get an account on transifex.

Edit translations directly on Transifex webpage

Here you will see how easy it is 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 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. You will be directed to the geonode project site on transifex. To join the team, click on the language you want to add a translation in. Then a button Join the team will appaer. Hit it, and you will submit for permission to join.

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

  4. Start to Add a translation

    Click on the language where you want to add a translation. You’ll see some bars, e.g. javascript and master. Choose the one you want to add a translation and you will see a dialog window like this

    ../../_images/download_translation.png

    Now you have two options to start translating. Either you use the transifex interface (option 1) or you download the file to translate locally (option 2).

    Option 1

    To start translating using the Transifex interface, hit Translate now. 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!

    Option 2

    To translate in your favourite editor, download the file hitting Download file for translation. This will download a .po file, which includes the strings to be translated (msgid). Put your translation into the msgstr and when you’re done, save the file and upload it to transifex (using the same dialog window as for the download).

Translate on local machine from github

Using this options 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 firt 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.

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

Finally update ressources on transifex.com:

$ tx push -s -t

For documentation localization

Note

Section below is deprecated, since the docs are no more translated, to much work to maintain them in every language.

  1. As a firt step, generate all of the needed .pot files (any time from 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 (here using Italian /it), 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. Do a push to transifex to update translations on the server:

    $ tx push -s -t
    
  6. Finally build your html or pdf, and you should get the localized versions as well:

    $ make html LANG=it
    

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