wood burning stoves*
The moose likes Struts and the fly likes i18n Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "i18n " Watch "i18n " New topic
Author

i18n

Garandi Smith
Greenhorn

Joined: Apr 12, 2006
Posts: 1
Dear Reader,
In properties file I have the following

message.alphanumeric = A {0} contains only letters and numbers.

where {0} is replaced with the 2nd argument of

ActionError("message.alphanumeric", "Registration Number"); object.

However if I have message.alphanumeric in a different language, how to modify
ActionError(), to pick "Registration Number" in proper language from a properties file, instead of hard coding it?
Thanks in advance
Garandi
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Use the getResources() method in your Action superclass.

ActionError("message.alphanumeric", super.getResources(request, "registration.number.label"));

This method will get the message using the current locale, just as a <bean:message> would.


Merrill
Consultant, Sima Solutions
 
GeeCON Prague 2014
 
subject: i18n