You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sam Cyrus <ha...@yahoo.com> on 2012/06/26 18:38:56 UTC

Problem with internationalization/locale

Hi, 

I try to follow the Struts2 tutorial and I run with Java1.6 on Tomcat6. I've had a pair of issues. The recent one is with internationalization using locales. For my Register.java action, I have two properties files Register.properties and Register_es.properties for the default English and Spanish respectively, each containing the labels for the chosen local language. 

In my index.jsp, I have two links defined for each locale, as follows. But clicking on the Spanish one reads from the English properties and the labels are therefore in English anyway. Even when I deleted the English alternative, it continued to show in English. I cleaned the cache in Firefox, cleared the contain of the English Register.properties and deleted the application map in Tomcat, (I even manually deleted the war file from my project in Eclipse before rebuilding with Ant) but no change: 

<s:url action="registerInput" var="registerInputLink" >
 <s:param name="request_locale">en</s:param>
</s:url>
<p><a href="${registerInputLink}">Please register</a> for our prize drawing.</p>

<h3>Registro español</h3>
<s:url action="registerInput" var="registerInputLinkES">
    <s:param name="request_locale">es</s:param>
</s:url>
<p><a href="${registerInputLinkES}">Por favor, regístrese</a> para nuestro sorteo</p>

Best regards
/// Sam Cyrus


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


RE: Problem with internationalization/locale

Posted by Martin Gainty <mg...@hotmail.com>.
Hi Sam <s:param name="request_locale">en</s:param>why is request_locale en?

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > Date: Tue, 26 Jun 2012 09:38:56 -0700
> From: hamintouri@yahoo.com
> Subject: Problem with internationalization/locale
> To: user@struts.apache.org
> 
> Hi, 
> 
> I try to follow the Struts2 tutorial and I run with Java1.6 on Tomcat6. I've had a pair of issues. The recent one is with internationalization using locales. For my Register.java action, I have two properties files Register.properties and Register_es.properties for the default English and Spanish respectively, each containing the labels for the chosen local language. 
> 
> In my index.jsp, I have two links defined for each locale, as follows. But clicking on the Spanish one reads from the English properties and the labels are therefore in English anyway. Even when I deleted the English alternative, it continued to show in English. I cleaned the cache in Firefox, cleared the contain of the English Register.properties and deleted the application map in Tomcat, (I even manually deleted the war file from my project in Eclipse before rebuilding with Ant) but no change: 
> 
> <s:url action="registerInput" var="registerInputLink" >
>  <s:param name="request_locale">en</s:param>
> </s:url>
> <p><a href="${registerInputLink}">Please register</a> for our prize drawing.</p>
> 
> <h3>Registro español</h3>
> <s:url action="registerInput" var="registerInputLinkES">
>     <s:param name="request_locale">es</s:param>
> </s:url>
> <p><a href="${registerInputLinkES}">Por favor, regístrese</a> para nuestro sorteo</p>
> 
> Best regards
> /// Sam Cyrus
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>