wiki:doc/translation/Introduction

Introduction

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

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)
  • Apply to the desired language team (if you have not done so already)
  • Wait to be approved for your team

If you do not hear back within 1 week, please contact emmapeel <at> torproject <dot> org with your Transifex username and the team you applied for.

  • Click on your language
  • Choose the resource you wish to translate
  • Click Translate now

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

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

For developers

Getting your translations added to Transifex

  • Check [Transifex] for supported file types
  • Contact emmapeel <at> torproject <dot> org with a link to your English strings, preferably in Tor Project or Tails git
  • Wait for strings to be added to Transifex and git

Using your translations

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

Translators' input

The translators find many errors on the source strings, it is important to have a look at the open issues in transifex.

Open issues in transifex: https://www.transifex.com/otf/torproject/translate/#issues (needs login)

After selecting a string, check the Comments section on the bottom right: there you will see the issue the translator has found.

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 master
git checkout --orphan $project
echo *.tx > .gitignore
git add .gitignore
git commit -avm "Initial import for $project"
git push origin  $project

Do this for both resources you're creating (also _completed: )

git checkout master
git checkout --orphan $project
echo *.tx > .gitignore
git add .gitignore
git commit -avm "Initial import for $project"
git push origin  $project

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

sudo -u translation bash
cd /srv/translation.torproject.org/translations
git clone git@git-rw.torproject.org:translation.git $project
cd $project
git checkout $project

Do this for both resources you're creating.

cd /srv/translation.torproject.org/translations
git clone git@git-rw.torproject.org:translation.git $project\_completed
cd $project\_completed
git checkout $project\_completed

Create the Transifex configuration file

cd /srv/translation.torproject.org/translations
mkdir $project/.tx $project/.tx
touch $project/.tx/config $project/.tx/config
mkdir $project\_completed/.tx $project\_completed/.tx
touch $project\_completed/.tx/config $project\_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) :

vim $project/.tx/config

[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 $project\_completed/.tx/config, but make sure you include the following line at the bottom:

minimum_perc = 100

Pull translations from Transifex

cd $project
tx pull -a -s
git add .
git commit -avm "pulling translations from transifex"
git push
cd ../$project\_completed
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
Last modified 5 weeks ago Last modified on Aug 16, 2018, 8:51:22 AM