a question about struts internationalization
how do i make my code to be internationalized?
suppose i have the code like this
ActionMessages errors =new ActionMessages();
errors.add("passwd",new ActionMessage("errors.name.required"));
how do i make my code to be internationalized?
suppose i have the code like this
ActionMessages errors =new ActionMessages();
errors.add("passwd",new ActionMessage("errors.name.required"));
Set your locale to the struts maintained session variable called "Globals.LOCALE_KEY".
For example, You want the messages to be displyed in Spanish like in Spain.
import javax.servlet.http.HttpSession;
import org.apache.struts.Globals;
import org.apache.struts.Globals;
import java.util.Locale;
..................
HttpSession session = request.getSession(false);
Locale sLocale = new Locale("es","SP");
session.setAttribute(Globals.LOCALE_KEY, sLocale);
If you need to maintain different languages on the same application and same locale, set the locale in Globals.LOCALE_KEY in struts action everytime the language button is clicked on the JSP.
Good Luck!!
Raj Palanichamy