Re: [Webwork-user] I18n and more
Brought to you by:
baldree,
rickardoberg
From: Rickard <ri...@jb...> - 2000-12-06 07:41:18
|
Hi! "Maurice C . Parker" wrote: > Since we are on the subject of i18n, I have notice that I am hard coding a lot of English error messages in my actions. Of course I could use a resource bundle, but I was thinking that doing an i18n error message lookup by default in ActionSupport and ActionFormSupport would be more convenient. Hm, well, I don't think this needs to be in the base support classes. It's very simple to do in an application base class, or in each action if you want to. protected ResourceBundle getMessages() { return ResourceBundle.getBundle("myaction", getLocale()); } public object execute() { // Validation if (.. error detected ..) { addErrorMessage(messages.getString("error.occurred")); // Get localized message } } Or what did you have in mind? /Rickard -- Rickard Öberg Email: ri...@jb... |