|
|
Imported from https://gitlab.torproject.org/legacy/trac/-/wikis/doc/l10n-coordinator
|
|
|
|
|
|
# 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](htt
|
|
|
ps://gitweb.torproject.org/translation-tools.git) and [translation.git](https://gitweb.torproject.org/translation.git). The rest of this section will assume that you are adding the The Metadata Anonymiza
|
|
|
tion Toolkit to Transifex ([#7892](https://trac.torproject.org/projects/tor/ticket/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](https://www.trans
|
|
|
ifex.com/projects/p/torproject/), 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_:
|
|
|
|
|
|
* Update the _Source File URL_ field with the URL to _mat-gui.pot_: https://gitweb.torproject.org/user/jvoisin/mat.git/blob_plain/HEAD:/po/mat-gui.pot
|
|
|
* Tick the box that says _Automatically Update Source File_ and click _Save_
|
|
|
|
|
|
### 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 tran
|
|
|
slation you wish to upload and click _Upload file_. Repeat for each existing translation.
|
|
|
|
|
|
### Update the configuration file in the translation-tools.git repository
|
|
|
|
|
|
Clone the repository:
|
|
|
|
|
|
```
|
|
|
git clone ssh://git@git-rw.torproject.org/translation-tools.git
|
|
|
cd translation-tools
|
|
|
```
|
|
|
|
|
|
Add the new resource to the PROJECTS variable in the config file, in alphabetical order.
|
|
|
|
|
|
There will always be two resources ($project and $project\_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:
|
|
|
|
|
|
```
|
|
|
git clone ssh://git@git-rw.torproject.org/translation.git
|
|
|
cd translation
|
|
|
```
|
|
|
|
|
|
Then use
|
|
|
|
|
|
|
|
|
```
|
|
|
git checkout master
|
|
|
git checkout --orphan $project
|
|
|
echo *.tx > .gitignore
|
|
|
git add .gitignore
|
|
|
git commit -avm "Initial import for $project"
|
|
|
git push --set-upstream origin $project
|
|
|
```
|
|
|
|
|
|
|
|
|
Do this for both resources you're creating (also _completed: )
|
|
|
|
|
|
|
|
|
```
|
|
|
git checkout master
|
|
|
git checkout --orphan $project\_completed
|
|
|
echo *.tx > .gitignore
|
|
|
git add .gitignore
|
|
|
git commit -avm "Initial import for $project\_completed"
|
|
|
git push --set-upstream origin $project\_completed
|
|
|
```
|
|
|
|
|
|
|
|
|
### Set up the resource on the translation server
|
|
|
|
|
|
Log in to majus, our translation's host.
|
|
|
|
|
|
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
|
|
|
export project='project_slug'
|
|
|
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\_completed/.tx/
|
|
|
touch $project/.tx/config
|
|
|
touch $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:
|
|
|
|
|
|
|
|
|
```
|
|
|
vim $project\_completed/.tx/config
|
|
|
|
|
|
minimum_perc = 95
|
|
|
```
|
|
|
|
|
|
### 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 --mode=reviewed
|
|
|
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
|
|
|
``` |
|
|
\ No newline at end of file |