Hi!

My mail application could not open your message correctly due to some error
in encoding, so my answers are marked by [KP]:

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 14:22
Subject: i18n best practice


Hello

The i18n transformer is a great solution for the creation of multilingual
content. So far I have found no documentation on how to best implement
language change. ATM I see two possibilities:

[KP] i18n transformer is not responsible for language selection, it accepts
a 'locale' parameter (since C2.0.4) which can be generated by a variety of
ways: URI parts, request parameters, retrieved from a DB and of course
generated by the LocaleAction.

(1) create URL's with ?locale=xx_YY

[KP] This is a common technic for 'changing' the current language (which
will be stored in session by LocaleAction if configured)

(2) store the state of the actual user locale in the session

[KP] This is possible for ages by the LocaleAction. And even more, you can
also store locale in a cookie, so that when the user re-visits your site
you'll get the locale that he's selected last time.

While (1) is straightforward to achieve with stylesheet parameters, it feels
somewhat messy. Solution (2) seems more elegant, however I need some advice
how to:

[KP] For (1) you will need to add '?locale=xx_YY' only in one place - this
link for language change.

(2a) store and change the locale in the session
(2b) query the locale from the session and handle it to the i18n-transformer

I guess (2b) is what LocaleAction is for.

[KP] LocaleAction is both: for 2a and 2b. Simply take a look at the i18n
samples in /webapp/samples/i18n directory). (Note, that there is also the
old i18n directory in /webapp/i18n in C2.0.x versions - it should be
removed, do not look at it).

[KP] Konstantin

Thanks for all hints

Martin


--
Martin L?thi                 [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