You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Cagle <Da...@sas.com> on 2006/09/11 20:49:23 UTC

Trouble with titleKey attribute for Frame and Link elements

Hey everyone!

I'm having trouble with the 'titleKey' attribute resolving to the correct translated title when the locale of my web app is something other than English.  I'm currently only using the 'titleKey' on a couple of <html:frame> and <html:link> elements, but when I change the locale, the text is always in English.  Is there something that I'm missing, like another tag to add to my JSP or another attribute?  Thank you for your help!

Currently using Struts 1.2.9

----------------------------------------
David Cagle



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


Re: Trouble with titleKey attribute for Frame and Link elements

Posted by Antonio Petrelli <ap...@apache.org>.
David Cagle ha scritto:
> I was able to find the "org.apache.struts.action.Action.setLocale(HttpServletRequest arg0, Locale arg1)" method and it seems to do the trick.  Before I just had "<fmt:setLocale value="${helpSession.locale}" scope="request" />" where "${helpSession.locale}" was the correct locale.  Most of the labels were taken care of with that but the titles of the <html:frame> and <html:link> elements were not getting translated.  The Action.setLocale method seems to take care of them.
>   

I don't know if you are doing the right thing. Anyway check 
"LocaleAction" out, it could be useful:
http://struts.apache.org/1.x/struts-extras/apidocs/org/apache/struts/actions/LocaleAction.html

Ciao
Antonio

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


RE: Trouble with titleKey attribute for Frame and Link elements

Posted by David Cagle <Da...@sas.com>.
Thanks Antonio for the question!  I think I figured the problem out last night.

I was able to find the "org.apache.struts.action.Action.setLocale(HttpServletRequest arg0, Locale arg1)" method and it seems to do the trick.  Before I just had "<fmt:setLocale value="${helpSession.locale}" scope="request" />" where "${helpSession.locale}" was the correct locale.  Most of the labels were taken care of with that but the titles of the <html:frame> and <html:link> elements were not getting translated.  The Action.setLocale method seems to take care of them.

Thanks once again!

-----Original Message-----
From: Antonio Petrelli [mailto:brenmcguire@tariffenet.it] 
Sent: Wednesday, September 13, 2006 4:50 AM
To: Struts Users Mailing List
Subject: Re: Trouble with titleKey attribute for Frame and Link elements

David Cagle ha scritto:
> Hey everyone!
>
> I'm having trouble with the 'titleKey' attribute resolving to the correct translated title when the locale of my web app is something other than English.  I'm currently only using the 'titleKey' on a couple of <html:frame> and <html:link> elements, but when I change the locale, the text is always in English.  Is there something that I'm missing, like another tag to add to my JSP or another attribute?
>   

That's definitely strange... How do you change your locale?


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


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


Re: Trouble with titleKey attribute for Frame and Link elements

Posted by Antonio Petrelli <br...@tariffenet.it>.
David Cagle ha scritto:
> Hey everyone!
>
> I'm having trouble with the 'titleKey' attribute resolving to the correct translated title when the locale of my web app is something other than English.  I'm currently only using the 'titleKey' on a couple of <html:frame> and <html:link> elements, but when I change the locale, the text is always in English.  Is there something that I'm missing, like another tag to add to my JSP or another attribute?
>   

That's definitely strange... How do you change your locale?


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