Hi all,
we are trying to let users switch their language - whether they are logged in or not - through a language selector. This can be either the ULS, which is progressing impressively, or just a list of languages in the sidebar, or anything else. After selecting it, the page is rerendered using the uselang parameter.
Now the problem: the uselang parameter is not sticky. When I move to another page, it is lost.
We tried to change the linker in order to add the uselang parameter every time -- but it only works in the content, not in the sidebar and actionlinks.
We could put the language into a cookie, as the ULS currently does, but this means that the squid caches won't work, afaik.
We could take the output just before it is send to the browser and regex-substitute all the links in order to add the uselang parameter every... OK, half joking. Only half.
Another solution could be to put the language into the path, i.e. the pretty URL /wiki/San_Franicisco does get rewritten to /w/index.php?title=San_Francisco as of now, but change that to /hr/San_Francisco rewritten to /w/index.php/San_Francisco?uselang=hr
(or /w/index.php/Special:UseLang/hr/San:Franciso with an Alias if this is more pleasing)
I think this is based on an idea of Brion during the Hackathon.
So switching the user language amounts to change the URL.
Any comments on this?
Cheers, Denny