8000 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value by Restless-ET · Pull Request #15048 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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

Closed

Conversation

Restless-ET
Copy link
Contributor
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. :)

@OskarStark
Copy link
Contributor

👍

@xabbuh
Copy link
Member
xabbuh commented Jun 26, 2015

👍

ping @symfony/deciders

@xabbuh xabbuh added the Ready label Jun 26, 2015
@@ -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; ?>
Copy link
Contributor

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

@aitboudad
Copy link
Contributor

👍

@fabpot
Copy link
Member
fabpot commented Jun 27, 2015

@Restless-ET Can you rebase this PR on 2.3 to get rid of the merge commit?

@Tobion
Copy link
Contributor
Tobion commented Jun 27, 2015

👍

@Restless-ET Restless-ET force-pushed the no-translation-empty_value branch from ad77418 to 6cc211b Compare June 27, 2015 15:49
@Restless-ET
Copy link
Contributor Author

@fabpot PR rebased. :)

BTW, is any action required from me regarding #14997?

@Tobion
Copy link
Contributor
Tobion commented Jun 27, 2015

Thank you @Restless-ET.

Tobion added a commit that referenced this pull request Jun 27, 2015
…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
@Tobion Tobion closed this Jun 27, 2015
@Restless-ET Restless-ET deleted the no-translation-empty_value branch June 27, 2015 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0