Polls labels Russian pluralization missing translations


(Ilya Kuchaev) #1

Already reported

The core has some same lables like new posts counter in main menu with the same bug.


(Jeff Atwood) #2

Is this a bug, or simply not translated yet?


(Mittineague) #3

I may have missed it, but I couldn’t find “few” anywhere in the plugin.
Closest I could find was in the plugins clients.__.yml files eg.

en:
  js:
    poll:
      voters:
        zero: "voters"
        one: "voter"
        other: "voters"

(Sam Saffron) #4

Pluralization is weird, try looking at crazy welsh for example

This is just a missing translation, there is no concept of “few” # like there is in Russian in English


(Gerhard Schlager) #5

But it’s not possible to translate those strings in Transifex. I guess we have to figure out if this is a bug in Transifex and hope that they fix it someday or if something can/should be done with the translation files in Discourse.

https://meta.discourse.org/t/a-better-poll-bar-chart-feature/28008/91?u=gerhard&source_topic_id=30235

(Sam Saffron) #6

Hmmm do we even ship polls to transifex?


(Gerhard Schlager) #7

Yes, the locale files of the poll plugin are available on Transifex.


(Mittineague) #8

But do they even have a “few” property?

i still haven’t been able to find where that is coming from.


(Ilya Kuchaev) #9

(Sam Saffron) #10

Some languages have differing pluralization rules

Eg Arabic nplurals == 6

http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html

You can’t fit 6 buckets into 3 buckets

We need to figure out how to communicate this to transifex cc @neil @techAPJ


(Gerhard Schlager) #11

It’s coming from the pluralization rules:

The Russian locale uses one, few and other.
The English locale uses one and other.

Transifex doesn’t detect a string as pluralized when the English locale file contains pluralizations different from one and other (e.g. it uses zero). That’s why few is not available in Transifex for those strings in the Russian locale.

I don’t think there’s a need for that. They already support up to 6 plural forms and all the supported languages should be configured correctly on their side.
If I’m not mistaken removing all the zero and many keys from the English locale should be enough.


(Sam Saffron) #12

Then we should fix our scripts to do that @techAPJ


(Gerhard Schlager) #13

I submitted a PR that should fix this as soon as the translations are pushed to Transifex.
https://github.com/discourse/discourse/pull/3574

BTW: Should the following keys be pluralized too?
https://github.com/gschlager/discourse/blob/patch-2/plugins/poll/config/locales/client.en.yml#L30-L34
If I’m not mistaken count will never be 1 for those keys, so the missing pluralization doesn’t matter for languages like English or German. But I imagine it could be a problem for languages like Russian…

I messaged the Transifex support and asked if they can change the algorithm that detects pluralization to support the special case of “zero”. If they can’t do that we’d need to rename all “zero” keys in the locale files and change the calls to I18n.t for those keys… There’s only one “many” key in the locale files and that’s a valid one.


(Ilya Kuchaev) #14

Any updates here? There are also the same issues in the main Russian translation.


(Gerhard Schlager) #15

Unfortunately not. My PR hasn’t been merged yet.
I’m not sure how the team intends to fix the pluralization problems in the main translation files.

@kuchaev_iv Can you take a look at the following strings? Should they be pluralized too in order to create a proper Russian translation?


(Régis Hanol) #16