8000 Gender and number-dependent words in translation · Issue #27132 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Gender and number-dependent words in translation #27132
Closed
@codedokode

Description

@codedokode
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version irrelevant

In many languages (for example, in Russian) the words in phrases use different forms depending on gender and count. For example, in this phrase:

Ivan has shared 5 files and 3 documents.

in Russian the word "shared" has two forms depending on user's gender and words "files" and "documents" depend on numbers before them. Currently Symfony Translation has no support for this. The method transChoice() is too limited and is not usable in many cases.

PHP Intl extension has formatMessage method that can handle such cases. Formatting syntax. But it requires to embed pluralization rules in every translated message. This can be solved by using "select" instead of "plural" and delegating choice to an external function.

So the question is, would not it make more sense to use Intl's formatter as default?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0