Thank you Konstantin! "Konstantin Piroumian" <[EMAIL PROTECTED]> writes: > My mail application could not open your message correctly due to some error > in encoding, so my answers are marked by [KP]:
Gnus wanted to know the encoding style (latin-1), sorry! > [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. That's what I understood from the samples and experimentation. > (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) This is what I tried. My problem was, that subsequent requests used again the first locale. With a little experimentation I found that this depends on cookies (of course, the session identification!). This is why I asked > (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. ok > (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). Well, as far as I see, everything works now when cookies are enabled. Would URL-rewriting be an options if no cookies are allowed? 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]>