This comes from working with xowiki, though it is a problem that we might encounter in general.
Use case: We have a site http://www.crfproject-eu.org/?site=E4 which we want to transfer over to xowiki for a couple of reasons. Getting the content in is the easy part (now that I know how to do it). What bothers me though is the fact that when I click on a language flag on the existing site, I see the content and the navigation in that language. In XoWIKI I can set the language flag to eg. ua:index or pl:index, but this will not change the categories language to the left, as this is still dependent on the browser setting (which may not be pl or ua by default).
Obviously I could rewrite the categories portlet to take the locale (explicitly like " -locale "en" ") and pass it the locale given by the URL. But this will only help me if I'm not allowing a fallback to the default language (e.g. if there is no Polish page, do not show the English one, otherwise, if you show the English one, the categories portlet would show up in English as well). I am aware that you would not be able to navigate to the English page through the categories while looking at them in Polish, but maybe someone provided an internal link ...
So much for the lengthy use case, now to the question. How can I set a locale for a user who is not logged in.
Rationale is, if I could set the locale explicitly for a user who is not logged in, then the problem would go away. Even better, if he looks at the site, the whole site shows up in his locale (e.g. forums, blogger etc.). And, once he registers, we would be able to set the default locale for him accordingly.
I checked and acs-lang does not seem to set a cookie, it relies on the browser setting and the user locale in the database. Question though is, is setting a cookie the smartest solution here? Or is there another trick?