|
Thanks a lot!!!
Now I optain the Locale, but I must find a way to optain a reference to my struts resource messages. Is a easy way to do this in TableDecorator??? there is some new stuff in display tag that I not very familar to do with pluging different i18n provides in to it.
The simplest solution for you (see that you're using struts anyway) is to use the TagUtils.message() method in org.apache.struts.taglib. From MessageTag.doStart(){ String message = TagUtils.getInstance().message( pageContext, this.bundle, this.localeKey, key, args); } or a even quicker/simplier way is to get the MessageResources is getPageContent().findAttribute(Globals.MESSAGE_KEY); Note this should give you the default messages, which may not be what you want (struts modules and all) Gareth I haven't heard anything from Olaru on this so I guess somebody needs to close this issue for him.
Gareth The same desire localization also exists for columns (
pageContext is already available in tableDecorators, as explained in comments, closing
|
||||||||||||||||||||||||||||||||||||||||||||||||||
in a TableDecorator you have access to the PageContext (getPageContext())
Struts leaves the current users Locale in the session under Globals.LOCALE_KEY (Globals is in package org.apache.struts). Some thing along the lines of:
Locale loc = (Locale)getPageContext().findAttribute(Globals.LOCALE_KEY) ;
Hope this helps.
Gareth