I am trying to do I18N in STRUTS. The problem is, I am getting only the french version of the application on each request.
Here is what I did:
I provided a form element in the index.jsp, with the hidden input field called language and it's value is "fr"
(The plan is to display initially in english and on clicking the form, change the language of the page)
The following is my struts-config.xml
On clicking the above form with the hidden input, ChangeLocaleAction class will be called and here is the code for the ChangeLocaleAction.java
I am developing in eclipse and I have the .properties files in test package of src folder.
here are the names of my .properties files
MyAppRes.properties
MyAppRes_fr.properties
I am also giving the code of LocBean
I am currently testing it in eclipse(helios) using the tomcat plugin.
Please tell me where I went wrong. Thanks in advance.
Also, I need to display the language button only when the users are viewing the english version. I don't want the language button when the user is viewing the french version. How do i achieve this?