Extension talk:LanguageSelector/Flow export
{{#switch:en| doesn't work for log-out visitor
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, Amqui (talk) 05:35, 12 February 2013 (UTC)
- The parameter you want is "uselang", not "setlang". ☠MarkAHershberger☢(talk)☣ 00:56, 13 February 2013 (UTC)
- 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. Bawolff (talk) 19:39, 14 February 2013 (UTC)
- All I know is that their site did change the displayed page when I altered the URL to uselang instead of setlang. ☠MarkAHershberger☢(talk)☣ 20:26, 14 February 2013 (UTC)
- 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). Bawolff (talk) 16:04, 15 February 2013 (UTC)
- "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. siebrand (talk) 10:01, 2 November 2013 (UTC)
- 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. Bawolff (talk) 19:29, 6 November 2013 (UTC)
- "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. siebrand (talk) 10:01, 2 November 2013 (UTC)
- 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). Bawolff (talk) 16:04, 15 February 2013 (UTC)
- All I know is that their site did change the displayed page when I altered the URL to uselang instead of setlang. ☠MarkAHershberger☢(talk)☣ 20:26, 14 February 2013 (UTC)
Chinese variants
Sorry for the poor English, it is not my first language. As is, LanguageSelector doesn't automatically convert page contents to Chinese variants using the built-in ZhConversion.php. I added the following line below $user->setOption( 'language', $requestedLanguage );
in LanguageSelector.php:
$user->setOption( 'variant', $requestedLanguage );
Now the extension should convert the page content between Chinese variants, in addition to the UI elements. In theory it should also work for other languages with built-in language conversion. Specik (talk) 13:48, 17 July 2016 (UTC)
Logged-in user
For logged-in user the change of language lasts only for the current page. Display of next page brings the language back to the wiki language.
Is this intended behaviour? Jprodina (talk) 20:34, 8 April 2019 (UTC)