Thanks again :-)

L.

-----Messaggio originale-----
Da: Piroumian Konstantin [mailto:[EMAIL PROTECTED]]
Inviato: mercoledi 2 ottobre 2002 16.46
A: '[EMAIL PROTECTED]'
Oggetto: RE: i18n language choice


> From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]] 
> 
> Hmmm...I'm working with 2.0.3.

Yes, you are right. I was sure that I've ported that behavior also to 2.0.3,
but the source shows that I didn't. Although, the example shows parameter
usage and it doesn't work, actually. :(

> 
> Actually, I've noticed this behavior:
> 
> in my example, i18n transformation is not embedded into any 
> LocaleAction;

Actually, the LocaleAction is called internally, so it will lookup for a
'locale' in:
        - request parameters
        - session attributes
        - cookies
        - user's locale (request locale)

And all the above is the consequence of the LocaleAction usage.

Seems that I have to think about porting sitemap parameter usage to
2.0.3-dev as well... At least for the sample to work correctly.

Konstantin

> 
> - if I don't pass anything, neither in sitemap, request or 
> session, the client locale is used (I can tell since server 
> is English, clients are Italian :-));
> 
> - if I pass a sitemap parameter directly, as in previous 
> example (<map:parameter name="locale" value="en"/>), it 
> simply gets ignored, and client locale (Italian) is still used;
> 
> - if I pass a request parameter ( <URI>?locale=en ), it 
> correctly switches to English;
> 
> - if I set somewhere a session parameter 
> (<xsp-session:set-attribute 
> name="locale">en</xsp-session:set-attribute>), it correctly 
> switches to English;
> 
> Sure I'm doing something wrong. Anyway, this is fine for me, 
> since I'm going to store preferences in a session attribute.
> 
> 
> Thanks again,
> 
> L.
> 
> 
> -----Messaggio originale-----
> Da: Piroumian Konstantin [mailto:[EMAIL PROTECTED]]
> Inviato: mercoledÍ 2 ottobre 2002 14.49
> A: '[EMAIL PROTECTED]'
> Oggetto: RE: i18n language choice
> 
> 
> Passing the locale name using a sitemap parameter was added 
> since version 2.0.2 or even 2.0.3. In the older versions the 
> i18n transformer uses LocaleAction's method internally to 
> obtain the locale.
> 
> Check the sitemap in latest i18n samples 
> (/cocoon/samples/i18n/) - they use LocaleAction to get the 
> locale and then pass it to the i18n transformer. And it works. 
> 
> This functionality is implemented in 2.1 versions as well.
> 
> Regards,
>   Konstantin
> 
> > -----Original Message-----
> > From: Lorenzo De Sio [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 02, 2002 4:17 PM
> > To: Cocoon Users (E-mail)
> > Subject: i18n language choice
> > 
> > 
> > Hi,
> > 
> > I'm starting some work with the i18n transformer, and I'm
> > facing a problem. I want to choose the i18n language with a 
> > sitemap parameter, but passing the "locale" parameter seems 
> > to not work.
> > 
> > BTW, Everything works if I choose the language with a query
> > string "locale" param.
> > 
> > Here are a few sitemap fragments:
> > 
> > [...]
> > 
> >    <map:transformer
> >     logger="sitemap.transformer.i18n"
> >     name="i18n"
> >     src="org.apache.cocoon.transformation.I18nTransformer">
> >     <catalogue-name>messages</catalogue-name>
> >     <catalogue-location>i18n</catalogue-location>
> >    </map:transformer>
> > 
> > [...]
> > 
> >     <map:transform type="i18n">
> >         <map:parameter name="locale" value="en"/>
> >     </map:transform>
> > 
> > 
> > 
> > Thanks in advance,
> > 
> > L.
> > 
> > 
> ---------------------------------------------------------------------
> > Please check that your question  has not already been 
> answered in the
> > FAQ before posting.     
> <http://xml.apache.org/cocoon/faq/index.html>
> > 
> > To 
> unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> > For additional commands, e-mail:   
> <[EMAIL PROTECTED]>
> > 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to