cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: LangSelect, bug ?
Date Fri, 25 May 2001 13:44:43 GMT
> > I am going to change the LangSelect to make it more flexible and
> > configurable. I'll also take a look at that strange behavior with empty
> > params.
> >
> > I am going to make it able to store the selected language in a session
or
> > cookie (now only session is supported, but I couldn't get it working as
I
> > was expecting).
>
> By means of configuration and/or parameters I hope.

Sure :)

> > I am using the LangSelect inside of my new I18nTransformer
> > and I also interested in a good language selection mechanism.
>
> IIRC the language from the agent (browser) isn't respected, right? Would
> be a great improvement to have it so users can set their preferred
> language in their browsers and langSelect can choose it from there as
> well.

That is the one of the features that have to be implemented.
I am thinking of such sequence of language selection:

1. Check request for a param with a name 'lang' (if the user choosed another
language manually).
2. Lookup for a 'lang' cookie.
3. Lookup for a session attribute 'lang'.
if none of this is succesful, then:
4. Check the accept-languages header and select the first (supported by
application) language.
if no supported langs or no information in the header:
5. Set the default language for the site (configured in the sitemap).
6. or set English as the current language.

So, on his first entry to the site the user will get either one of the
browser languages or the default one.
After he will choose a language (it comes from the request) then LangSelect
will be able to store  the current language in a cookie (and next time user
will get the page in that lang) or in the session (lang will be kept only
during the session and next time user will have to choose it again).

>
> > If there are any comments and ideas, I will take them into account.
>
> YUp ;)
>
> > After this weekend I think I will post a modified version of the
> > I18nTransformer and a new LangSelect action.
>
> Cool.

I hope so, but nobody knows what could happen to me this weekend :))

>
> Giacomo

Konstantin.


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message