APSL/redux-i18n

Plural-Forms is ignored

Closed this issue · 7 comments

From what I see, the Plural-Forms field of po files is ignored, for example, in french :

"Plural-Forms: nplurals=2; plural=(n > 1);\n"

This should give :

this.context.t(['{n} banana', '{n} bananas', 'n'], {n: 0}) // => "0 banane"
this.context.t(['{n} banana', '{n} bananas', 'n'], {n: 1}) // => "1 banane"
this.context.t(['{n} banana', '{n} bananas', 'n'], {n: 2}) // => "2 bananes"

Maybe I missed something ? If not the case, I can make a PR.

Hi,
you are right. This is a bug. Can you paste me the po file content here, please? I will solve it.
Thanks

Here is a simple file :

msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr_FR\n"

#: src/renderer/page/Home.tsx
msgid "Translate this text"
msgstr "Traduis ce texte"

#: src/renderer/page/Home.tsx
msgid "{n} dog"
msgid_plural "{n} dogs"
msgstr[0] "{n} chien"
msgstr[1] "{n} chiens"

Thanks! Give me one week :)

Hi,
I'm working about that in this branch. When done, I will let you know for test it.

https://github.com/APSL/redux-i18n/tree/_60_pluralize_fix

Thanks.

Hi,
its done :).

#61

When you can, please review this pull request and tell me what do you think about that.

Thanks!

Hi!

Well, I think that I already have it. And now is compatible with all language rules ;).

What do you think about this code?

Thanks.

Hi!
I've just published a new version 1.5.10 ;)
Best regards.