Contribute a translation to Discourse

translation

(Jeff Atwood) #1

So you’d like to help us translate Discourse into other languages? Great! Let’s get started.

Translators

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.

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.

Setup

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:

tx --help

Create ~/.transifexrc and add your credentials:

[https://www.transifex.com]
hostname = https://www.transifex.com
password = my-transifex-password
token = 
username = myemail@example.com

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.

You can use the language code as argument if you want to pull only a specific language. For example, if you want to pull French translations, run the script like this:

ruby script/pull_translations.rb fr

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
Reviewers for Danish
How to properly display jalali dates for Persian language
Translation to Azerbaijan language
How to find and amend un-translated strings
How to contribute to Discourse
HTML tags in plaintext digest when missing a translation
Korean translation mistake
Discourse creators can you add lithuanian language to next update?
Discourse Development Contribution Guidelines
Stuck trying to add new locale files
How to edit existing language
(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 admin_js.admin.email.title 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

en:
  js:
    posts:
      controls:
        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>
</button>

(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.


#16

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:


#18

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.