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

Skip to content

[Form] Avoid button label translation when it's set to false #25249

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
wants to merge 1 commit into from
Closed

[Form] Avoid button label translation when it's set to false #25249

wants to merge 1 commit into from

Conversation

TeLiXj
Copy link
Contributor

@TeLiXj TeLiXj commented Dec 1, 2017

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

Improve my previous contribution to hide button label when it's set to false (#24148) because a missing translation error appears

Improve my previous contribution to hide button label when it's set to false (#24148) because a missing translation error appear
@nicolas-grekas
Copy link
Member

your previous contrib was for 2.7, you submitted against master, but described as 4.0
what's the right choice?

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Dec 1, 2017

It was on 2.7 branch but fabpot merged it into 3.4/4.0 branch. Now it's the same, only for 3.4/4.0 branches

@xabbuh xabbuh modified the milestones: 2.7, 3.4 Dec 7, 2017
@xabbuh
Copy link
Member

xabbuh commented Dec 7, 2017

Isn't the real issue that we try to display false in the first place?

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Dec 8, 2017

@xabbuh what do you mean?

@xabbuh
Copy link
Member

xabbuh commented Dec 8, 2017

<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</button>

Here we always display the label variable. Why do we do that even when it is false.

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Dec 8, 2017

Print false is same as print nothing because this I only check for label false one time.
If you don't print label when it's false (as you suggest) we have two options with the current code: check 2 times if label is false or execute previous ifs for nothing and finally ask if it's false. Maybe both are clear but less "microefficient".
We are writting more than the real impact of this change :)

@nicolas-grekas nicolas-grekas changed the base branch from master to 3.4 December 12, 2017 12:08
@nicolas-grekas nicolas-grekas changed the base branch from 3.4 to 4.0 December 12, 2017 12:08
@nicolas-grekas nicolas-grekas changed the base branch from 4.0 to master December 12, 2017 12:09
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(for 3.4)

@fabpot
Copy link
Member

fabpot commented Jan 17, 2018

Thank you @TeLiXj.

fabpot added a commit that referenced this pull request Jan 17, 2018
…se (TeLiXj)

This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #25249).

Discussion
----------

[Form] Avoid button label translation when it's set to false

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

Improve my previous contribution to hide button label when it's set to false (#24148) because a missing translation error appears

Commits
-------

368edd8 Avoid button label translation when it's set to false
@fabpot fabpot closed this Jan 17, 2018
This was referenced Jan 29, 2018
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.

5 participants