Localization

From Gephi:Wiki
Jump to: navigation, search

Gephi has a localization program to provide the software in your language: this page describes how to get in! We use the Transifex platform.

Short and long term team goal

Lots of people are not ease with English. The goal is to distribute Gephi also in French, Spanish and other languages the community will ask for.

Translation guide

Get started!

  1. Create an account on Transifex.
  2. Ask to be part of a Translation Team.
  3. If no team is set for your language, please ask to create one on the forum.
  4. When accepted, start translating it!

Note: when you start to translate a resource, Transifex grants you a "write lock" on it for 48h. It means that you will be the only one able to edit this resource in your language during this period, thus avoiding conflicts.

Important Note: only English texts should be written directly in the .properties files. All the translations should be made on Transifex platform otherwise they will be overridden.

Technical Details

Language strings are stored in Bundle.properties files, the common format used in Java world. We want to keep this simple mechanism, as Gephi has more than 240,000 lines of code now. In order to provide an efficient way to translate the application, Gettext .pot files (PO templates) are regularly generated and automatically submitted to Transifex. PO files are basically composed by string identifiers (msgid) and corresponding translations (msgstr).

Transifex allows to manage the translation process: each language has a user interface, like the French one. Translators simply translate English strings on a web page. Once done, Gephi admins retreive the translated strings and push them to the Gephi trunk.

Workflow for admins

The Transifex client is available here. All the following commands are executed from the Gephi repository root.

Setup

Initialize Transifex for Gephi (done only once and for all):

  1. Execute properties2pot.sh to refresh the local template files (POT).
  2. Execute python set_transifex.py to scan recursively the Gephi repository and add POT files and existing PO files to the local Transifex config file (in .tx/config).
  3. Execute $tx push -t to push local translations (PO files) to the Transifex platform.

Update template files

  1. After modifying a Bundle.properties file or creating a new Gephi module, execute properties2pot.sh to refresh the POT files.
  2. Execute tx push -s to push sources (POT files) to Transifex platform.

Synchronize the repository

  1. Execute tx pull -f to pull the translations (PO files) once translations are done. The local repository does now contain the up-to-date translations.
  2. Execute po2properties.sh to update the .properties files. The translations are now available in the Gephi UI.

After adding a new Gephi module

If we add a module called "org-gephi-data-attributes-api":

  1. Execute properties2pot.sh to refresh the local POT files.
  2. Execute tx set --auto-local -r gephi.org-gephi-data-attributes-api --source-language=en --source-file org-gephi-data-attributes-api.pot "<lang>.po". This means "automatically find translations for this resource in this folder with this expression". This action updates the local Transifex config file (in .tx/config).
  3. Execute tx push -s to push sources (POT files) to Transifex platform.

After removing a Gephi module

  1. Delete the related lines in .tx/config
  2. Manually remove its resources on the Transifex platform.

Tools

Common terminology

Read the Generic Vocabulary.

How to get in contact with the team

How to force UI language in Gephi

Go to gephi/nbproject/private, then edit platform-private.properties by adding the line (French for instance):

run.args.extra=--locale fr:FR

Netbeans Tips

Search for a string by doing Edit > Find in Projects (Ctrl + Maj + F), with the file name pattern *.properties.

Resources