Chinese translations with counts

(Neil Lalonde) #1

Continuing the discussion from German Translation Sync between GH and Transifex:

I see your problem now. In our client.zh_TW.yml file, we have translations for things like less_than_x_seconds:

        half_a_minute: "< 1 分鐘"
          one:   "< 1 秒鐘"
          other: "< %{count} 秒鐘"

But they’re missing from Transifex.

So I tried pushing our client.zh_TW.yml file to Transifex, which was successful, but those translations are still missing.

@samuelchan22 Any idea what’s wrong?

EDIT: It seems like Transifex has these translations, but isn’t displaying them. I pushed them, and when I pull from Transifex, they come back.

(Samuel Chan) #2

To be honest, I’m not sure. Your best bet would be to email support [at] transifex [dot] com and include “Bug” in the subject line. One of our engineers can help you with technical issues like these.

(Neil Lalonde) #3

Thanks, Samuel. I emailed them today.

(Neil Lalonde) #4

Here’s the reply from support:

Transifex handles the string the way you described exactly because Chinese (Taiwan) has only one plural form (so there’s translation only for the “other” field).
This is a different case from English. English has two plurals so it requires translation entries for both “one” and “other” fields.

As a result you should only translate the “other” field and this is the expected way for the resulting Yaml file to look like:

other: “< %{count}s”

If you have set the plural rules for Chinese (Taiwan) correctly in your application then it will work.
It won’t expect to find an entry for the “one” case since the language has only one plural form.

I hope that sheds some light to the issue.

As for the Transifex UI, I guess only the “other” should be translated.

@fantasticfears Does that help? Can you add the “other” translations for keys like less_than_x_minutes?

(Erick Guan) #5

It’s also what I want exactly. But the translation is missing something if I left “one”.

Actually I check out the plurals.rb before, it should have work as the support says. Maybe I miss something. I just don’t know how it works and it’s scope.

Right now, the translation includes “one”. You can find the translation with only “other” before FIX: Extra `&` character · discourse/discourse@8b7212f · GitHub.
And that’s what happened. Discourse Meta

(Neil Lalonde) #6

Everything on our end is working, but I’m not merging the zh_TW files from Transifex right now because they don’t include any of the other: keys. Actually, less_than_x_seconds.other is coming from Transifex.

I think they just need to be redone in Transifex. They show as untranslated. I don’t know if you need to put the translation in one or other in the UI, but somehow they need to be added.

(Erick Guan) #7

I’m sorry to mention this. Check zh_CN! Currently, I only have time to handle and test this variant now.

(Neil Lalonde) #8

Oops, looks like it’s @staryume who translates zh_TW. zh_CN has everything we need.

(Leung Aaron) #9

I just translated the Chinese zh_TW version until 0.8.9 version (before transifex is implemented for discourse) .

BTW , (maybe a little bit off topic ) , now in the 0.9 version, the chinese version translation is broken in [] :

not sure whether the 0.9.1 version or the latest versions will fix this or not .

(Neil Lalonde) #10

The most recent code from today fixes that.

(Leung Aaron) #11

so it shall be better for me to wait until to perform a forum update ?

(Neil Lalonde) #12

No need to wait. Update any time!

(Erick Guan) #13

Because I manually add “one” for many item. I still don’t know how to left the “one” blank and make it work. Let’s put this thing aside if you don’t have much time.

Related file: discourse/plurals.rb at master · discourse/discourse · GitHub

@aaroleung Since I translated zh_CN, you can run a script to add translation for TW. Then you can edit variants manfully. This can help you not waste time doing almost the same work.

(Erick Guan) #14

@neil add pluralization rules in ember for Chinese by fantasticfears · Pull Request #2266 · discourse/discourse · GitHub This PR should fix the missing translation.

Since nobody complains their translation is missing, I have added rules just for Chinese.

Notice: Transifex strips the one: for Chinese, but left it and other: in editor.

(Neil Lalonde) #15

Thanks, it’s merged.

(Jong Eun Lee) #16

Korean (ko) has same problem.
Thanks @fantasticfears .
I just make a pull request for Korean.

(Neil Lalonde) #17

Merged, thanks for fixing.