-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.4] Replace symfony's translator #15563
[5.4] Replace symfony's translator #15563
Conversation
Hey nice work, it reminds me of an issue I opened last year. I think you can also remove the $domain param from the helper functions as I stated on the previous issue. |
@kamui545 yeah good catch, updated :) |
Looks awesome, nice work 😄 |
I think that translator contract should also implement |
So, all plural rules from https://github.com/symfony/translation/blob/master/PluralizationRules.php isn't applicable now. Most of the translations are broken. Thanks... |
@cjmaxik Could you provide a way to reproduce your issue? That would be helpful. |
en 'apples' => ':count apple|:count apples', 1 apple | 2 apples | 24 apples | 2657 apples ru 'apples' => ':count яблоко|:count яблока|:count яблок', Should be 1 яблоко | 2 яблока | 24 яблока | 2657 яблок There is more plural rules then one|many. |
@themsaid Why did you break plurals for Russian language? I guess not the only Russian plurals were broken. |
Laravel uses its own Translator in most of the situations, the only part where we use Symfony's translator is in
trans_choice()
.This PR adds a replacement to the
MessageSelector
class used intrans_choice()
and removes all instances of Symfony's translator from the code base.The new
MessageSelector
supports the same basic functionality supported by Symfony's with some slight changes to the syntax:[1,Inf]
is now[1,*]
[*,5]
one:one record|many: many records
support, it'll match in this order by default.