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

Appearance settings

Gender and number-dependent words in translation #27132

Copy link
Copy link
Closed
@codedokode

Description

@codedokode
Issue body actions
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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.