You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React-intl uses the ICU message syntax, which means that if you want to specify different translations for different plural forms, it looks something like this:
You have {itemCount} {itemCount, plural, one {item} other {items}}.
This issue also applies to translations with ordinal numbers, for which react-intl uses ICU's selectordinal. This could also be converted to PO format. However, I propose we limit the scope of this issue to translating cardinal plurals (i.e., plurals like the example above, where react-intl uses the plural keyword). That being said, any solution we come up with should probably keep in mind that we'll want to translate selectordinal as well. I'm happy to take lead on this and come up with a PR. Let me know your thoughts!
The text was updated successfully, but these errors were encountered:
It will be great to handle the plural use case, but I have no time to dive
into it. I am happy to see a PR for this feature. 😍
Sand1929 <notifications@github.com>於 2017年11月23日 週四,20:14寫道:
React-intl uses the ICU message syntax, which means that if you want to
specify different translations for different plural forms, it looks
something like this:
You have {itemCount} {itemCount, plural, one {item} other {items}}.
(See https://formatjs.io/guides/message-syntax/#plural-format)
When converted into PO format using react-intl-po, it currently looks like
this:
msgid "You have {itemCount} {itemCount, plural, one {item} other {items}}"
However, in PO format, plural forms are supposed to be specified like this:
msgid "You have %1 item"
msgid_plural "You have %1 items"
msgstr[0] ""
msgstr[1] ""
(And you can specify msgstr[2] and so on for languages with more than 2
plural forms. See
http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html)
This issue also applies to translations with ordinal numbers, for which
react-intl uses ICU's selectordinal. This could also be converted to PO
format. However, I propose we limit the scope of this issue to translating
cardinal plurals (i.e., plurals like the example above, where react-intl
uses the plural keyword). That being said, any solution we come up with
should probably keep in mind that we'll want to translate selectordinal
as well. I'm happy to take lead on this and come up with a PR. Let me know
your thoughts!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#98>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABdOS-yAM2I5TlEpIO6hOAsPcuuC5Tjyks5s5VOpgaJpZM4Qol2y>
.
--
Best,
==============================
Michael Hsu
React-intl uses the ICU message syntax, which means that if you want to specify different translations for different plural forms, it looks something like this:
(See https://formatjs.io/guides/message-syntax/#plural-format)
When converted into PO format using react-intl-po, it currently looks like this:
However, in PO format, plural forms are supposed to be specified like this:
(And you can specify
msgstr[2]
and so on for languages with more than 2 plural forms. See http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html)This issue also applies to translations with ordinal numbers, for which react-intl uses ICU's
selectordinal
. This could also be converted to PO format. However, I propose we limit the scope of this issue to translating cardinal plurals (i.e., plurals like the example above, where react-intl uses theplural
keyword). That being said, any solution we come up with should probably keep in mind that we'll want to translateselectordinal
as well. I'm happy to take lead on this and come up with a PR. Let me know your thoughts!The text was updated successfully, but these errors were encountered: