Contribute a translation to Discourse

(Jeff Atwood) #1

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
sudo python
sudo pip install transifex-client

Test that it worked:

tx --help

Create ~/.transifexrc and add your credentials:

hostname =
password = my-transifex-password
token = 
username =

Leave the token empty as shown above.

Get translations

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.

ruby script/pull_translations.rb

That’s it.

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:

  1. In the Transifex web UI, go to the resource list and upload the new source file (the english version) by clicking the “Add new resource” button.
  2. Edit the .tx/config file to add the file, and any filename mappings for locales like French, where we use fr and Transifex uses fr_FR.

How to add a new language
How to use latest translations on my own discourse
How to add translation client.xx.yml and server.xx.yml files to the server?
Error while pulling translations from Transifex
RTL support
How to properly display jalali dates for Persian language
Discourse Development Contribution Guidelines
Stuck trying to add new locale files
HTML tags in plaintext digest when missing a translation
Korean translation mistake
How to find and amend un-translated strings
Translation to Azerbaijan language
How to contribute to Discourse
How to edit existing language
Reviewers for Danish
(Sam Saffron) #2

We should really get tx push -s into some sort of post commit hook @neil

Difficulties for translating. Can you give me context informations?
(Eric Vantillard) #3

is it possible to add some translator mode ?

command = "tx pull #{ARGV.include?('translator') ? '--mode=translator -a' : '--mode=developer'} #{ARGV.include?('force') ? '-f' : ''}"

(Gzoritchak) #4

As a regular french user of discourse (manage 3 instances) I regularly see small bugs in french translations. I asked to join the french team of translators but it was rejected. How can I do to notify the translations bugs?

(Régis Hanol) #5

@techAPJ can you have a look?

(Arpit Jalan) #6

You must have sent the new language request. Anyone can join the translation team without requiring any permission.

BTW, I just added you as translator for French (France) team.

(Gzoritchak) #7

And is it possible to propose some improvements on the langue source?

For exemple: the string for is “Email”. It should be at the plural form. We are talking about tons of emails sent or skipped.

Thank you for:

(Kane York) #8

For English, submit pull requests or open discussion topics on Meta.

(Pad Pors) #9

can icons also be translated using transifex? how?
currently the icons seem to be translated using the google.translate which doesn’t offer the best translation.

(Régis Hanol) #10

What “icons” are you talking about?

(Pad Pors) #11

for example the ‘like’ or ‘share’ buttons are translated badly in Persian, such that if there was no image next to the text, no one would guess what they may be.

e.g. “like” is translated as “similar to”.

(Mittineague) #12

I don’t know Farsi, but Google translate for “like” from the client.fa_IR.yml

        reply: "آغاز ساخت یک پاسخ به این نوشته"
        like: "شبیه این نوشته"
        has_liked: "شما این نوشته را لایک کرده اید"
        undo_like: "برگنداندن لایک"

gives “Like this post” which except for the first letter case matches exactly the HTML

<button title="like this post" aria-label="like this post" class="widget-button toggle-like like">
<i aria-hidden="true" class="fa fa-heart"></i>

(Pad Pors) #13

thanks. I’m Persian, and “شبیه این نوشته” means “similar to this post” or “alike this post”; I mean the translate uses the other meaning of like (i.e. alike).

or for “share” it gives “همرسانی” which i can’t translate it back to English, since it’s not really a word or at least a common word.

Is there a way to change these? currently we’re on a Persian-discourse platform, and I can list all the uncommon Persian icons therein, in a 2-3 week period.

I just don’t know how to implement/report the changes to make such a list more useful to the community.

(Régis Hanol) #14

They should all be on transifex. It’s just a matter of figuring out the right string.

(Tomas Ibarra) #15

Hi, my name is Tomas Ibarra, and i want to join to the translator team, i’m a recent rails developer from Mexico, i can help with developing issues and translation issues.


How often are translations merged into stable?

(Felix Freiberger) #17

Every few days, so you shouldn’t have to wait for too long :slight_smile:


The translation was last updated on Aug 12, 2016 on stable. So it seems longer than a few days. :wink:

(Gerhard Schlager) #19

At most once or twice shortly after the initial release of a stable version.
Why? Because there’s only one translation project on Transifex and that’s for the master branch.

I suggest you use the beta branch if you need translations that are somewhat up-to-date.

(Kane York) #20

Correct, translations are only merged into stable when code is released on stable.

Translations are continuously merged every few days into the development branch tests-passed which is merged every week or so into the beta branch.

Discourse does not hire professional translators that make sure every string has a translation as part of the release process, so this is the system we have.