[strus] LOCALE

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top