Skip to content

Adding Translations to Dashboards

Iván Perdomo edited this page Dec 12, 2019 · 2 revisions

Translation process

Below, we describe the different steps in the process to add new translation keys.

  1. In the code, we use translatable string keys starting with an underscore, such as _please_click_save
  2. After the code is saved, we generate translation strings by scanning the whole code for such strings, and put the resulting keys in the file GAE/src/locale/ui-strings.properties in alphabetical order. The translate process also creates the en.properties file from all key-value pairs in ui-strings.properties.

docker-compose exec akvo-flow /app/src/ci/run-as-user.sh bash
cd GAE
mvn exec:java -Dexec.mainClass="services.TranslationGenerator" -Dexec.args="/app/src/Dashboard/app /app/src/GAE/src/locale"

  1. When this is complete, the text value for the key (in this case Please click save) is added manually to the ui-strings.properties file.
  2. After adding the value, we run the translate process again again, so the newly added values are copied to the en.properties file
  3. In the Transifex translation ui, the resource file en.properties is reloaded, and new translation keys can be translated by native speakers. This process results in new translation files, in this case fr.properties and es.properties. The whole process is described in the Transifex section below.
  4. The new translation files fr.properties and es.properties are added to the GAE/src/locale folder and committed to the repo.

Transifex - contributing translations

  1. In the Transifex home screen, click on the Akvo-FLOW project
  2. Click Resource on the top right.
  3. Click on Akvo FLOW Admin ui in the list. This will display all three languages
  4. Click one of the languages, and select View strings online. This will show a translation user interface with all translatable strings on the left
  5. Select Untranslated at the top. This will show only the untranslated strings
  6. Select an item in the left column, and provide a translation in the middle column. When done, save it.

Transifex - downloading translation files

  1. Click the Akvo FLOW project, and select one of the languages, for example Spanish
  2. Click 'Akvo FLOW admin ui', and select 'Download for use'. this will download a for_use_akvo-flow_akvo-flow-admin-ui_es.properties.properties file for that language.
  3. Rename the file to just the two-letter code (es.properties), and store it in the GAE/src/locale folder.
  4. Repeat 1..3 for all languages, except the source language
  5. Commit the new translations to the repo.

Transifex - updating the source translation file

No idea.

Clone this wiki locally