I(f you have compnent MyComponent.jwc the create a MyComponent.properties
and put it there.  AbstractComponent defines methods getString() (overloaded
in a couple of ways) to retrieve a string and supply parmeters to it.

----- Original Message -----
From: "Roberto Saccon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 8:53 AM
Subject: [Tapestry-developer] Localization Question


> 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
>



-------------------------------------------------------
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