Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gender and number-dependent words in translation #27132

Closed
codedokode opened this issue May 3, 2018 · 2 comments
Closed

Gender and number-dependent words in translation #27132

codedokode opened this issue May 3, 2018 · 2 comments

Comments

@codedokode
Copy link

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?

@jvasseur
Copy link
Contributor

jvasseur commented May 3, 2018

There has been work done to try to add a formatter based on the Intl extension to Symfony (#20007) but it's currently blocked because it's hard to do it without breaking BC.

@nicolas-grekas
Copy link
Member

fixed by #27399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants