-
-
Notifications
You must be signed in to change notification settings - Fork 151
SelectBox: options translation can be disabled #53
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
src/Forms/Controls/SelectBox.php
Outdated
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.
What an ugly name. What about $translateValues = TRUE?
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.
That was my first shot, but what about it's setter? From the name translateValues() I would guess that that method will return translated values and not just set a flag. Also logic of such method might be confusing (inverted)... What do you think?
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.
The confusion might be caused by double negation. Rather then $disable<sth> = FALSE, which means "it's ok, go", bool value should start with verb, like in question (e.g. "is container generated?"). I'd suggest $doTranslateValue, or rather $doTranslateOptions, because it's called on $options property.
@castamir Great idea btw. We use custom select box with translations off by default on it's values.
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.
@TomasVotruba thx for response.
src/Forms/Controls/SelectBox.php
Outdated
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.
Missing bool annotation
|
👍 |
2782ccd to
ae38142
Compare
b644bbd to
3b543ff
Compare
|
👍 |
|
ping @dg Could you please give me some feedback? |
|
doTranslateOptions is really bad name. I am considering another approach #58 … |
75b0565 to
72a5c56
Compare
164ee7d to
7b7189f
Compare
131f7d2 to
532059a
Compare
a57a557 to
55d0eb8
Compare
To prevent SelectBox values from being translated, we had to disable entire translator from this control and translate label and option-descript manualy.
I propose an opposite aproach - possibility to not translate these values =)