Should i18n happen in controller or view?
What you think would be better approach, to get localized messages in controller and then put them into model or to put into model message keys and internationalize them in view? So far i used latter approach -- less code.
Actually, I have more general question, what data you put into model, value objects or already HTML formatted strings(representing dates etc) which view only displays? How dumb should be view?
Re: Should i18n happen in controller or view?
Quote:
Originally Posted by tv
What you think would be better approach, to get localized messages in controller and then put them into model or to put into model message keys and internationalize them in view? So far i used latter approach -- less code.
I'd use the latter approach as well.
Quote:
Originally Posted by tv
Actually, I have more general question, what data you put into model, value objects or already HTML formatted strings(representing dates etc) which view only displays? How dumb should be view?
Definately objects (not "value" objects though, use real ones!). If you pass in html strings then you've effectively moved rendering into the model and out of the view.