Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert react-intl's plural syntax to PO format plural syntax #98

Open
@Sand1929

Description

@Sand1929

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

(Seehttps://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 specifymsgstr[2] and so on for languages with more than 2 plural forms. Seehttp://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'sselectordinal. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp