Topic on Extension talk:LanguageSelector

{{#switch:{{int:Lang}}| doesn't work for log-out visitor

7
Amqui (talkcontribs)

Good day, I use {{#switch:{{int:Lang}}|en=blabla|fr=blabla}} to have the same page displays in the language chosen by the visitor. With &setlang=fr or en in the url, it works for log-in user. However, for visitor not logged in, even if they add &setlang=fr in the url, the page remains in English and only the title is in French. It had been tested on Google Chrome. And the tested page is http://wikimedia.ca/w/index.php?title=Projects/National_Contribution_Month&setlang=en or http://wikimedia.ca/w/index.php?title=Projets/Mois_national_de_la_contribution&setlang=fr. How come? Thanks,

MarkAHershberger (talkcontribs)

The parameter you want is "uselang", not "setlang".

Bawolff (talkcontribs)

setlang is a parameter used by certain extensions (Language Selector? maybe) where uselang is part of core

Possibly the language selector extension is configured to not work for anons to prevent issues with squid caching.

MarkAHershberger (talkcontribs)

All I know is that their site did change the displayed page when I altered the URL to uselang instead of setlang.

Bawolff (talkcontribs)

Hmm, yeah. Something looks borked with that extension. Only about half the messages seem to change with setlang. I would guess that whatever hook Language selector extension is using to muck about with $wgLang is being called to late (or the extension only changes some of the RequestContext objects (not all) or something like that).

Siebrand (talkcontribs)

"setlang" is a URL parameter provided by Extension:UniversalLanguageSelector. In all wiki's hosted by Wikimedia Foundation, persistent language selection for anonymous users is disabled. This feature is enabled by default in ULS, but disabled in Wikimedia wikis because of worries about cache fragmentation. "uselang" is a URL parameter provided by core, that only works for a single page view.

Bawolff (talkcontribs)

I don't think that is the issue. User was claiming that setlang was succesfully changing the language on only part of the interface for anons. If setlang was disabled for anons on his/her install, I would expect it to change none of the interface language.

Reply to "{{#switch:{{int:Lang}}| doesn't work for log-out visitor"