This content has been marked as final.
Show 3 replies
-
1. Re: Get localized messages in code
lvdberg Jan 13, 2010 6:05 PM (in response to jaand96)Use the following:
@In Map<String, String> messages;
-
2. Re: Get localized messages in code
mikkus70 Jan 13, 2010 6:46 PM (in response to jaand96)Leo's suggestion is ok if you just need to retrieve a key value, but if your messages have EL expressions themselves as in
my.welcome.message=Hello, #{identity.username}!
then you need to interpolate the key returned. Messages could also contain positional parameters ({n} values), in this case you need to supply them yourself while interpolating.
There is a FAQ article that explains how to retrieve and interpolate message strings from Java here.
-
3. Re: Get localized messages in code
jaand96 Jan 14, 2010 7:47 AM (in response to jaand96)worked like a charm, thanks!