S
Stefan Dammeier
Hello,
I am try to build a multilingual application. At the beginning the default
should be in a special language, english for example.
Then I have to links, both execute my "changeLanguageAction"
Inside following code will be executed:
Object language = request.getParameter("language");
System.out.println("sprache: " + language);
if (language==null){
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.ENGLISH);
return mapping.findForward("katalog");
}
if (language.equals("en")) {
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.ENGLISH);
}
if (language.equals("de")) {
System.out.println("sprache auf deutsch gesetzt");
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.GERMAN);
}
return mapping.findForward("katalog");
}
But nothing happens, the message keys just take the properties files as
before. I heard different versions of how to set up my web.xml and
struts-config.xml for this.
But what is the right one, what I have to write into my web and
struts.config in order to change the properties.file for the right language
immediately?
My properties files are placed in the classes folder.
Thank you for your action!
Stefan
I am try to build a multilingual application. At the beginning the default
should be in a special language, english for example.
Then I have to links, both execute my "changeLanguageAction"
Inside following code will be executed:
Object language = request.getParameter("language");
System.out.println("sprache: " + language);
if (language==null){
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.ENGLISH);
return mapping.findForward("katalog");
}
if (language.equals("en")) {
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.ENGLISH);
}
if (language.equals("de")) {
System.out.println("sprache auf deutsch gesetzt");
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,
Locale.GERMAN);
}
return mapping.findForward("katalog");
}
But nothing happens, the message keys just take the properties files as
before. I heard different versions of how to set up my web.xml and
struts-config.xml for this.
But what is the right one, what I have to write into my web and
struts.config in order to change the properties.file for the right language
immediately?
My properties files are placed in the classes folder.
Thank you for your action!
Stefan