struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: Locale="true" in html:html tag
Date Fri, 16 Apr 2004 06:00:43 GMT
Joe Hertz wrote:

>Craig McClanahan writes:
>
>  
>
>>-----Original Message-----
>>From: Craig McClanahan [mailto:craigmcc@apache.org] 
>>Sent: Thursday, April 15, 2004 7:48 PM
>>To: Struts Users Mailing List
>>Subject: Re: Locale="true" in html:html tag
>>
>>
>>Joe Hertz wrote:
>>
>>    
>>
>>>This has been deprecated in 1.2.
>>>
>>>My internationalized pages appear not to need this at all 
>>>      
>>>
>>with 1.2. The 
>>    
>>
>>>Locale seems to get detected from the browser just fine without it.
>>>
>>>Since, I never got around to serious internationalization 
>>>      
>>>
>>while I was 
>>    
>>
>>>using 1.1, I thought this was necessary for the jsp page to 
>>>      
>>>
>>auto-select 
>>    
>>
>>>it's locale. Am I misunderstanding what the purpose of locale="true" 
>>>was?
>>>
>>>If not, how have things changed? Is it now assumed to be the default 
>>>unless a lang specific lang parameter is specified in the 
>>>      
>>>
>>html:html tag 
>>    
>>
>>>or something?
>>>
>>>Basically it seems like it just went away, and now the 
>>>      
>>>
>>functionality it 
>>    
>>
>>>provided now shows up when it's needed "as if by magic", 
>>>      
>>>
>>which I'm sure 
>>    
>>
>>>ain't so. :-)
>>>
>>>What exactly has changed here? I'm kind of curious (and 
>>>      
>>>
>>okay, somewhat
>>    
>>
>>>suspicious) now...
>>>
>>> 
>>>
>>>      
>>>
>>No conspiracies here :-).  The deprecation comment about the "locale" 
>>attribute explains what is going on, and the description of 
>>the "lang" 
>>attribute describes the algorithm that is used.
>>http://jakarta.apache.org/struts/userGuide/struts-html.html#html
>>
>>This page, like all the rest of the Struts documentation, is also 
>>available locally if you unpack (and perhaps deploy on a server) the 
>>struts-documentation.war webapp.
>>    
>>
>
>Actually, this page is what made me _start_ scratching my head...If I
>hadn't seen it, how would I known to ask about the lang attribute? :-)
>
>So let me better explain myself.
>
>In reading it before I made the assumption that lang was to specify the
>language for the page like this: <html:html lang="en">, and if I wanted
>the same functionality as before I needed to do something like
><html:html lang="<%=language%>">. In reading it now, I'm gathering
>that's not the case :-), but anyway I figured I'd find the answer by
>experimenting a little...
>
>And <drum roll>...without specifying Locale OR Lang, it displayed in
>Russian like a champ when I told IE6 to make Russian the primary
>language it looked for!
>
>I was thusly inspired to post my question: Since it worked without
>specifying it, what does this tag really do for me? Under what
>circumstances do I really need to have this type of thing specified?
>
>  
>
You don't need it at all if you're willing to let the user's language 
selection in the browser control everything (which is the default 
behavior).  If you want to offer a "change Language" control, you'll 
need to use either lang="true" or locale="true" (and make sure there's a 
session) so that Struts can keep track of the user's non-default locale 
choice.

>-Joe
>
>  
>

Craig


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


Mime
View raw message