You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by he...@epidataconsulting.com on 2004/04/22 16:46:22 UTC

setLocale

Hi. I have been trying to get to work the i18n in an application I'm
working on and can't make it work. I found something wrong in the
setLocale. In the login Action I'm using the following code:
---
	LoginAdminForm f = (LoginAdminForm) form;

	if (f.getLang().equals("es")) {
		Locale local = new Locale("es");
		System.out.println("Espanol: " + local.getLanguage() + "_" +
local.getCountry() );
		setLocale(request, local);
	}else if (f.getLang().equals("pt")){
		Locale local = new Locale("pt");
		System.out.println("Portugues: " + local.getLanguage() + "_" +
local.getCountry());
		setLocale(request, local);
	}
 	System.out.println(request.getLocale().getLanguage() + "_" +
request.getLocale().getCountry());
---

When I select Spanish (f.getLang() equals "es"), I get
Espanol: es_
en_
in the server console. So the setLocale(request, local) isn't working. Any
ideas why?
I'm using Tomcat 5.0.19 and Struts 1.1

Thanks in advance
Hernan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org