I am developing
struts 2 and spring web application which suppoerts two languages: english and hindi.
I have configured internationalization but it is not working i.e. when I change the encoding from browser, the text does not change.
I have tried to even change the locale programmatically but it still does not work
//struts.properties
struts.custom.i18n.resources=global-messages
//RegisterAction.java
public class RegisterAction extends ActionSupport {
public
String execute(){
return "SUCCESS";
}
public Locale getLocale(){
return new Locale("hi");
}
}
//struts.xml
<action name="register" class="com.medics.action.RegisterAction">
<result name="SUCCESS">/Register.jsp</result>
</action>
//Register.jsp
<%@ taglib prefix="s" uri="/struts-tags" %>
<h4><s:text name="RegisterMessage"/></h4>
//global-messages.properties
hello=hello
RegisterMessage=Registration
//global-messages_hi.properties
RegisterMessage=\\u2354\\u2379\\u327\\u2367\\u2344\\u2381
struts.xml and the two messages files are in the root of the classpath
Please help me