-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation][Form][choice] empty_value shouldn't be translated when it has an empty value #15048
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
Conversation
👍 |
👍 ping @symfony/deciders |
@@ -7,7 +7,7 @@ | |||
)) ?> | |||
<?php if ($multiple): ?> multiple="multiple"<?php endif ?> | |||
> | |||
<?php if (null !== $empty_value): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo $view->escape($view['translator']->trans($empty_value, array(), $translation_domain)) ?></option><?php endif; ?> | |||
<?php if (null !== $empty_value): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo empty($empty_value) ? $empty_value : $view->escape($view['translator']->trans($empty_value, array(), $translation_domain)) ?></option><?php endif; ?> |
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.
php empty() also return true for '0'
which is not what we want (and which is not equivalent to the twig empty test). so you need to test if ('' == $empty_value)
instead
👍 |
@Restless-ET Can you rebase this PR on 2.3 to get rid of the merge commit? |
👍 |
…HP templating engine.
…('empty_value' option) are no longer translated.
ad77418
to
6cc211b
Compare
Thank you @Restless-ET. |
…lated when it has an empty value (Restless-ET) This PR was squashed before being merged into the 2.3 branch (closes #15048). Discussion ---------- [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The same fix provided at #14997 but against ```2.3``` branch. @webmozart As requested. :) Commits ------- 1a5c4c6 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value
The same fix provided at #14997 but against
2.3
branch.@webmozart As requested. :)