wiki:doc/translation/Introduction

Version 28 (modified by phoul, 4 months ago) (diff)

--

Introduction

This page explains how the translation process works for translators, developers, and those who manage it all. The process is currently managed by Colin Childs.

Workflow

What follows is a short summary of the translation workflow for existing resources. Instructions on how to add a new translation resource can be found further down on this page.

  • Users translate our resources on Transifex
  • Each translation resource has its own branch in the translation repository
  • A cron will pull new and updated translations from Transifex and add them to the translation repository
  • Developers clone the translation repository, check out branches, validate the translations, and include them in new releases

For translators

  • Create an account on Transifex
  • Visit our project page
  • Request the creation of a translation team for your language (if it does not exist)
  • Add yourself to the language team (if you have not done so already)
  • Click on your language
  • Choose the resource you wish to translate
  • Click Translate now

To access the glossary:

  • Click on your language
  • Choose the resource you wish to translate
  • Click Translate now
  • Click Glossary (next to the search box, above the strings)

If you need to edit the Glossary (to upload a new English version, for example), log in and go to https://www.transifex.com/tools/glossary/

When translating, make sure you include any HTML tags, URLs, and symbols present in the English string.

Note that Tails resources can be translated either on Transifex or with Git, depending on the language.

For developers

  • Clone the translation repository
  • Check out the branch for your project (e.g. git checkout mat-gui)
  • If you only want translations that are 100% completed, check out the _completed branch instead (e.g. git checkout mat-gui_completed)

NOTE: Transifex does not do any kind of input validation on the translated strings. You need to make sure that the strings you include are valid and do not contain anything malicious.

For those who manage the translation process

To add a new translation resource, you will need three things: admin access on Transifex to add the new resource, access to Tor's translation server, and permission to push to translation-tools.git and translation.git. The rest of this section will assume that you are adding the The Metadata Anonymization Toolkit to Transifex (#7892).

Create the resource on Transifex

Download mat-gui.pot from http://gitweb.torproject.org/user/jvoisin/mat.git or clone the repository locally and find the po file. Log on to Transifex, navigate to our project page, click on Resources and Add new resource:

  • Resource file: locate mat-gui.pot
  • Name: type in Tails - mat-gui.pot
  • I18N Type: select PO File (.po)

Click Create resource and wait for the page to refresh. You should now see the page for the resource you just added. Click on Edit resource:

Add existing translations

If the resource has existing translations, you will need to add them as well. Navigate to the page for the resource you just added, click Add new translation, select the language, locate the first translation you wish to upload and click Upload file. Repeat for each existing translation.

Update the configuration file in the translation-tools.git repository

Add the new resource to the PROJECTS variable in the config file, in alphabetical order. There will be always be two resources ($NAME and $NAME_completed), here they are mat-gui and mat-gui_completed. Commit the changes and push them to the translation-tools repository.

Prepare branches in the translation repository

Each translation resource gets its own branch in the translation repository. First clone the translation repository, then use

  • git checkout --orphan mat-gui
  • echo *.tx > .gitignore
  • git add .gitignore
  • git commit -avm "Initial import for mat-gui"
  • git push origin mat-gui

Do this for both resources you're creating.

Set up the resource on the translation server

Switch to the translation user and navigate to /srv/translation.torproject.org/translations. Clone the translation repository, and check out the branch into the corresponding directory

  • git clone git@…:translation.git mat-gui
  • cd mat-gui
  • git checkout mat-gui

Do this for both resources you're creating.

Create the Transifex configuration file

  • mkdir mat-gui/.tx mat-gui_completed/.tx
  • touch mat-gui/.tx/config mat-gui_completed/.tx/config

Edit mat-gui/.tx/config with the information below. The first line is the resource slug, which is a part of the URL for that specific resource on the Transifex website. The second line specifies how new translations should be saved (i.e. with just the language code as the filename) :

[torproject.tails-mat-guipot]
file_filter = <lang>.po
source_file = mat-gui.pot
source_lang = en

[main]
host = https://www.transifex.net

Add the same information to mat-gui_completed/.tx/config, but make sure you include the following line at the bottom:

minimum_perc = 100

Pull translations from Transifex

  • cd mat-gui
  • tx pull -a -s
  • git add .
  • git commit -avm "pulling translations from transifex"
  • git push

Do this for both resources you're creating.

Update the translation-tools repository and activate the config file

  • cd /srv/translation.torproject.org/tools
  • git pull