Skip to content

Add new translations

Katharina edited this page Jun 11, 2018 · 14 revisions

We use the transifex client to get the latest translations. Resources are the files that are uploaded on transifex and need to be translated into other languages, at the moment they are: wheelmap.yml, relaunch.yml , categories.yml , ember.yml and authentication.yml. Wheelmap is available in 22 languages, english is the source language on which 21 other available locales rely on for translations, they can be found in locales.

Note transifex might require python3 (and pip3) as well as a newer version of urllib3. Run pip install urllib3 --upgrade if you have issues with the command.

First install pip:

via easy_install:

$ sudo easy_install pip

or from source:

$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py

or via Ubuntu packages:

sudo apt-get update
sudo apt-get install -y python-pip
python get-pip.py

Then install the transifex client:

via pip:

$ sudo pip install transifex-client

or from source:

$ git clone http://code.transifex.com/transifex-client
$ cd transifex-client
$ python setup.py install

Config .transifexrc:

Please check and config the file .transifexrc that should be located in your home folder. Learn more about it here.

Example config:

[https://www.transifex.com]
username = user
token =
password = p@ssw0rd
hostname = https://www.transifex.com

Change into the wheelmap project:

$ cd wheelmap

Now you are ready to pull the latest translation files from transifex.

Pulling files

To get all latest translation files, run:

$ tx pull 

# don't worry about where to put the files, it will be done automatically

or:

$ tx pull -f

# use force pull when transifex skips to pull specific files that you need though

Pull new language files with debug messages enabled

$ tx -d pull -a

Pull specific resources:

$ tx pull -r transifex.core
$ tx pull -r 'transifex.co*'

Pull specific resources

$ tx pull -r transifex.core
$ tx pull -r 'transifex.co*'

Then run:

$ bundle exec rake i18n:js:export 

# generates and exports translations to JS file(s) - no further precompiling needed

Important:

Don't use bundle exec rake generate:i18n_js anymore as this is legacy code that has to be removed in the future.

That's it! Nothing more to do here.


Check the status of the transifex resources files:

$ tx status

Check for all rake tasks with:

$ bundle exec rake -T

For further documentation, learn how to get started here: