Skip to content

Add new translations

Thuy Le edited this page Jun 21, 2016 · 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.

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.

To get the 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 

Check the status of the transifex resources files:

$ tx status

Then run:

$ bundle exec rake i18n:js:export 

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

Check for all rake tasks with:

$ bundle exec rake -T

That's it!

Important:

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

For further documentation, learn how to get started here: