Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false #16031

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

Restless-ET
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Seems like this behaviour was already partially added (as stated here) to solve the problem of expanded choice widgets.

@@ -57,7 +57,7 @@
{%- endif -%}
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
{%- if placeholder is not none -%}
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? placeholder|trans({}, translation_domain) }}</option>
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as (false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the extra space between as and (

same as(false)

@fabpot
Copy link
Member

fabpot commented Oct 12, 2015

@Restless-ET Can you add some unit tests to cover the changes?

@Restless-ET Restless-ET force-pushed the 2.8-disable-translations-when-translation_domain-is-false branch from dc506a8 to 8c4911f Compare October 12, 2015 21:11
@Restless-ET Restless-ET force-pushed the 2.8-disable-translations-when-translation_domain-is-false branch from 8c4911f to 709ac51 Compare November 14, 2015 16:04
@Restless-ET
Copy link
Contributor Author

@fabpot Added some unit tests as requested.
Sorry for the delay on this.

@Tobion
Copy link
Contributor

Tobion commented Nov 14, 2015

👍

Status: Reviewed

@xabbuh
Copy link
Member

xabbuh commented Nov 24, 2015

👍

@fabpot
Copy link
Member

fabpot commented Nov 25, 2015

Thank you @Restless-ET.

@fabpot fabpot closed this Nov 25, 2015
fabpot added a commit that referenced this pull request Nov 25, 2015
…laceholders when 'translation_domain' is false (Restless-ET)

This PR was squashed before being merged into the 2.8 branch (closes #16031).

Discussion
----------

[Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Seems like this behaviour was already partially added (as stated [here](#16016 (comment))) to solve the problem of expanded choice widgets.

Commits
-------

0e0b904 [Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false
@Restless-ET Restless-ET deleted the 2.8-disable-translations-when-translation_domain-is-false branch November 25, 2015 16:11
nicolas-grekas added a commit that referenced this pull request Nov 29, 2015
…colas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

Forward compatibility with AbstractLayout* 2.8 tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Related to #16031

Commits
-------

ef61e54 Forward compatibility with AbstractLayout* 2.8 tests
This was referenced Nov 30, 2015
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