So you’d like to help us translate Discourse into other languages? Great! Let’s get started.
Translators do all their work in the Transifex project for files listed there. Create an account at Transifex and join a team for one or more languages. You’ll be notified when there are new strings that need to be translated, and get emails when there are announcements.
After contributing translations to the Transifex project, there’s nothing more to do. The translations will be pulled into the Discourse repo periodically.
There are some files that are not being managed in Transifex yet, but will be added soon. Those still need to be changed manually and submitted with a pull request. The goal is to eliminate pull requests for translations entirely. We’ll get there before v1.
Discussions about the translations and how to improve the process should happen in Meta’s translations category.
What Discourse team does
We use the Transifex client to push and pull translations, and to manage which files belong in Transifex.
Installing the client is easy. First, you’ll need a Transifex account. Then, install the client.
On OS X:
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python get-pip.py sudo pip install transifex-client
Test that it worked:
~/.transifexrc and add your credentials:
[https://www.transifex.com] hostname = https://www.transifex.com password = my-transifex-password token = username = email@example.com
token empty as shown above.
To get new translations, we run a script that uses the client and does some post-processing to make sure everything is in a format that works.
If the output shows that everything was skipped and no files were pulled, then you’ll need to use the force option.
ruby script/pull_translations.rb force
The client looks at timestamps on your local files to determine if anything needs to be pulled, which can make it think that your files are newer than what’s on the server. That’s my theory anyway.
Push English file changes
When anyone changes the english translation files, they need to be pushed to Transifex so translators see that there’s work to do. This can be done with one command:
tx push -s
You’ll need manager privileges on the Transifex project.
Adding new files for translation
To add a new file for translation, you’ll need to do two things: