i use struts 1.3 and want to make localization.
that’s what I’m doing:
-
in struts-config.xml:
<form-bean name="English" type="org.apache.struts.action.DynaActionForm"> <form-property name="language" type="String" initial="en" /> </form-bean> <form-bean name="Russian" type="org.apache.struts.action.DynaActionForm"> <form-property name="language" type="String" initial="ru" /> </form-bean> <action-mappings> <action path="/English" name="English" type="org.apache.struts.actions.LocaleAction"> <forward name="success" path="/index.jsp" /> </action> <action path="/Russian" name="Russian" type="org.apache.struts.actions.LocaleAction"> <forward name="success" path="/index.jsp" /> </action><controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" /> -
on jsp.page
<html:link action="/Russian"> <bean:message key="jsp.header.russian"/> </html:link> <html:link action="/English"> <bean:message key="jsp.header.english"/> </html:link>
maybe i do something wrong? any ideas?
P.S. yes, i have messages_ru.properties and messages_en.properties.
Oh, I found the reason, struts do not know of this type as a String.