Forum OpenACS Development: Re: Explicit locale for not logged in user

Collapse
Posted by Michael Aram on
If I understand the approved TIP (https://openacs.org/forums/message-view?message%5fid=545011) right, the system should always use the ad_locale cookie if present and update its value when the user switches languages.

This seems not to be implemented in this form in OACS 5.3

I tested using an updated plain OACS 5.3 checkout (acs-lang 5.3.1) and found the following behaviour:

The cookie is only updated when the user is logged out. A language change of a logged in user is only saved in the database and the cookies value is left untouched.

This means:

1) Anonymous user comes to homepage -> Browser settings based locale is used
2) Anonymous user switches language -> Cookie bases locale is used
3) User logs in -> Locale stored in DB is used
4) User changes language -> Locale is updated in DB but not inside the cookie. DB version is used
5) User logs out -> Cookie based value is used again

We can have 4 different languages here in these 5 steps...

Is this analysis right or did I make any basic mistake in testing?

PS: You can test this behaviour directly on the openacs.org homepage, because here it is the same, although acs-lang 5.2.3 is installed here.