Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Translation] TransChoice invalid plural translation#31110
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Translation] TransChoice invalid plural translation#31110
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d3ded2f tof979deaCompareUh oh!
There was an error while loading.Please reload this page.
f979dea to9c13ce2CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/Resources/config/identity_translator.xmlShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
stof commentedApr 15, 2019
and this does not solve the similar issue when using the ICU format (MessageFormatter also throws for invalid pluralization) |
9c13ce2 to8a87162CompareSimperfit commentedApr 15, 2019
First of all thanks@ro0NL and@nicolas-grekas for the review, I'm working on this right now and wanted to know what we should return, an empty string ? Do we update all the translation components (such as TranslationExtension, MessageFormatter) or do we only do that on the transChoice of the IdentityTranslator so we are strictly following the issue. (that's what I've done right now, tell me if we want to go further. |
8a87162 to0aa48c2Compare
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what we should return
the default behavior?
| returnstrtr($id,$parameters); |
| <defaultspublic="false" /> | ||
| <serviceid="translator"class="Symfony\Component\Translation\IdentityTranslator"public="true" /> | ||
| <serviceid="Symfony\Component\Translation\TranslatorInterface"alias="translator" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the default identity translator above this one should be updated as well.. might even be a public alias toidentity_translator 🤔
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
ro0NL commentedApr 16, 2019
last but not least; |
Simperfit commentedApr 22, 2019
@ro0NL I don't know, I think it could be on the user at this point. |
0aa48c2 toa7fef52Compare
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@Simperfit isnt it weirdtransChoice is "debug-able" whereastrans() is not? Esp. sincetransChoice is deprecated.. so$debug is useless in 5.0?
Moreover, what to do with
symfony/src/Symfony/Component/Validator/ValidatorBuilder.php
Lines 336 to 338 ina7fef52
| $translator =newclass()implements TranslatorInterface, LocaleAwareInterface { | |
| use TranslatorTrait; | |
| }; |
Uh oh!
There was an error while loading.Please reload this page.
stof commentedApr 23, 2019
trans can throw in 2 cases:
|
Simperfit commentedApr 23, 2019
So what to do here ? Do we need to not throw and pass the debug directly in the trans method ? |
8a3fdb5 to1ee08d4Compare1ee08d4 toc7f5cf7CompareSimperfit commentedMay 18, 2019
I like how it's working right now@stof@nicolas-grekas tell me if I need to change something. |
Simperfit commentedMay 25, 2019
Status: Needs Review |
xabbuh left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we need to update other usage of theTranslatorTrait (inSymfony\Bridge\Twig\Extension\TranslationExtension andSymfony\Component\Validator\ValidatorBuilder) too?
And we need to mark any version of the Translation component as conflicting with the FrameworkBundle.
src/Symfony/Bundle/FrameworkBundle/Resources/config/identity_translator.xml OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
0732cc5 toc3d6800CompareSimperfit commentedJun 21, 2019
I don't know, maybe@ro0NL has some thoughts on this ? |
c3d6800 to1669eabCompareSimperfit commentedJul 17, 2019
Status: Needs Review |
Simperfit commentedAug 6, 2019
cc@xabbuh |
nicolas-grekas commentedAug 8, 2019
A test case would be nice please (+rebase needed) |
1669eab to47d6d7eComparesrc/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
noniagriconomie commentedDec 6, 2019
It will be very cool to have it in 4.4 as a bug fix, but i fear it will not be considered as it thank you working on this@Simperfit :) |
47d6d7e to5c5420bComparenicolas-grekas commentedFeb 3, 2020
Closing as this staled. |
noniagriconomie commentedFeb 3, 2020
@nicolas-grekas hello |
nicolas-grekas commentedFeb 3, 2020
I fixed all comments before closing so yes, this should be good to go on master, but with enough description in the PR to be able to understand the use case and that could act as the start of a documentation. |
noniagriconomie commentedFeb 12, 2020
@nicolas-grekas related to#28375 and as this is not considered as a bugfix, IMO sf 3 and 4 can not benefit this thank you |
nicolas-grekas commentedFeb 12, 2020
I don't know :) |
Uh oh!
There was an error while loading.Please reload this page.