You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by manuel aldana <al...@gmx.de> on 2009/04/05 19:21:43 UTC
[localization] reusing facilities for enum-names
I got a java enumeration and would like to reuse the nice localization
facilities from tapestry 5.
let's say I have an enum:
enum A{
ONE,TWO;
}
If it displays on a page I would like to have it displayed by the
language (e.g. 'one' for en or 'zwei' for german).
For displaying it on the page tapestry seems to use Enum.toString(). So
I would override toString() and read some localized values from property
files. How can I access tapestry localization facilities for that?
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [localization] reusing facilities for enum-names
Posted by Igor Drobiazko <ig...@gmail.com>.
Provide translations for your Enum in the page's message catalog.
For example in Page_de,properties:
A.ONE=Eins
A.TWO=Zwei
On Sun, Apr 5, 2009 at 7:21 PM, manuel aldana <al...@gmx.de> wrote:
> I got a java enumeration and would like to reuse the nice localization
> facilities from tapestry 5.
>
> let's say I have an enum:
>
> enum A{
> ONE,TWO;
> }
>
> If it displays on a page I would like to have it displayed by the language
> (e.g. 'one' for en or 'zwei' for german).
>
> For displaying it on the page tapestry seems to use Enum.toString(). So I
> would override toString() and read some localized values from property
> files. How can I access tapestry localization facilities for that?
>
> --
> manuel aldana
> aldana@gmx.de
> software-engineering blog: http://www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Best regards,
Igor Drobiazko
Re: [localization] reusing facilities for enum-names
Posted by Ulrich Stärk <ul...@spielviel.de>.
Use the Messages service.
Uli
Am 05.04.2009 19:21 schrieb manuel aldana:
> I got a java enumeration and would like to reuse the nice localization
> facilities from tapestry 5.
>
> let's say I have an enum:
>
> enum A{
> ONE,TWO;
> }
>
> If it displays on a page I would like to have it displayed by the
> language (e.g. 'one' for en or 'zwei' for german).
>
> For displaying it on the page tapestry seems to use Enum.toString(). So
> I would override toString() and read some localized values from property
> files. How can I access tapestry localization facilities for that?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org