Hi,

I have a couple of entity classes, like user, article, product. These
have some properties that can have a defined set of options, for example
the status could be "new", "approved" or "blocked". These options need
to be translated some where and some how.

For translation texts I always use palceholders with a different scheme
to keep texts separated, e.g. 'user_message_auth_missing_email',
'user_menu_user_login', 'application_heading_service', etc. For these
options I would use a "new" placeholder but a placeholder like
"user_option_status_new".

1. Would you rather inject the translator object and create a method
   in each entity class to return the translated value? With this
   approach I can build the placeholder "user_option_status_new" for
   the option "new" within this method.

2. Would you rather keep the untranslated value in the entity class
   and translate it in the view script? With that approach I need to
   build the placeholder "user_option_status_new" for the option "new"
   within the view scripts. Ok, I could write a view helper for it, but
   still this alternativ feels a little awkward.

How would you handle this?

Regards,

Ralf

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to