-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add default count parameter on transchoice #185
Add default count parameter on transchoice #185
Conversation
b259a6f
to
e2f62d6
Compare
Hi @monteiro and @willdurand :) Will you have a look at this PR soon? |
@@ -149,6 +149,11 @@ | |||
); | |||
|
|||
var _number = parseInt(number, 10); | |||
parameters = parameters || {}; | |||
|
|||
if (!parameters.count) { |
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.
this is wrong. You need to check whether it is defined or no. 0
should not be replaced if it is passed explicitly.
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.
Right, fixed now
@@ -149,6 +149,11 @@ | |||
); | |||
|
|||
var _number = parseInt(number, 10); | |||
parameters = parameters || {}; | |||
|
|||
if (!parameters.count) { |
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.
Please also add tests covering the case where the count is provided explicitly too
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.
Done
e2f62d6
to
13b5044
Compare
looks good to me! |
@pyrech thanks for the pr! The tests seems to be failing :( can you fix it? So we can merge this. |
@monteiro Tests were working before I rebased the PR. The error is |
I see what you mean @pyrech Let me fix it. |
@pyrech Can you rebase with master, so we can merge this PR with tests passed? Thanks a lot! |
13b5044
to
c7a67f3
Compare
c7a67f3
to
b36144c
Compare
Cool 👍 Just rebased the PR on top of master 😉 |
Thanks a lot! |
Awesome, you're welcome 🎉 |
The idea is to have a similar behavior between Symfony translator (TranslationExtension and symfony/symfony#19795) and the js translator.