-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
BaseControl, SelectBox: labels and prompt are translated by global translator #58
Conversation
So – what would the control's translator be for? |
setTranslator has sense for items on Choice & MultiChoiceControl. |
9303edc
to
45e02e5
Compare
b644bbd
to
3b543ff
Compare
I would very welcome this approach. Label and prompt via form's translator and items via control's. So It would not be needed to hack it - setTranslator(NULL) and then manually translate label and prompt. |
75b0565
to
72a5c56
Compare
Will this PR in Nette 2.3? |
164ee7d
to
7b7189f
Compare
I like the idea, but I suggest using overridable control's methods like Alternatively there could be properties and public setters for both types of these translators (setItemsTranslator, setOuterTranslator) and the default behavior could again be the same as outlined above. |
131f7d2
to
532059a
Compare
a57a557
to
55d0eb8
Compare
5f19501
to
105a1af
Compare
So what is the result? It seems, that it is still not possible to translate control with form translator, but leave control items untranslated. Is that right? Because use case, when selectbox items are gathered from database is very common. |
I think it can be merged to 3.0-dev |
a6ec22a
to
c2c4dc3
Compare
454e643
to
a8c2e65
Compare
571b36c
to
841e5de
Compare
This is just idea.
Error messages are since 6451fe0 translated by form's translator instead of control's one. It turned out to be the right decision. What about labels? I think that labels should be translated by form's translator too.
Maybe selectbox prompt too, but I am not sure.