Hi there

Localization works fine in Tapestry for Beans and Localized Strings but how
do I handle a Localized property, I wil call it "foo" in the example below
(which is rendered inside a Foreach-loop) ? Just taking the getString method
form AbstractComponent did not work, so I took the traditional approach, see
below.
Does Tapestry offer a more elegant way, where it is not necessary to
hardcode the RessourceBundle name ???

private static final String BUNDLE_NAME =  bla.bla.bla

public String getFoo()
{
    ResourceBundle RESOURCE_BUNDLE =ResourceBundle.getBundle(BUNDLE_NAME,
getPage().getEngine().getLocale());
    try
    {
        return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException e)
    {
        return '!' + key + '!';
    }
}



regards
Roberto




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to