Topic on Project:Village Pump/Flow

Update for the main page

4
Terasail (talkcontribs)

Posting this here so it is more visible, with this being a significant change to the way the main page works.

The Main page currently does not switch Chinese language versions correctly. Where all Chinese variants should be switched to /zh, currently only users who select zh will see the Chinese translation and all varients will see the english page. For example see MediaWiki/zh compared with MediaWiki/zh-Hans. I originally noticed this on Wikifunctions, and since the Wikifunctions main page was based on the one here I also checked and it is also an issue here. I recently proposed and edit to fix right-to-left on the main page after discussion with User:Quiddity on the issue at Wikifunctions.

The changes: I have updated MediaWiki/sandbox and Template:Main_page/sandbox and as you can see by sandbox/zh and sandbox/zh-Hans this correctly switches the language, I also removed the language switch from the template and moved it to the main page as this is the way I found that worked. After discussing with User:Tacsipacsi, I also changed Template:Main_page to use Module:Caller title as this appears to be the better approach, instead of my original solution to the problem.

Overall I am looking for this update to be added by an administrator so that Chinese language switching can be fixed as well as using the caller title module but also for it to be checked since I can't preview the change. I have already added it to Wikifunctions if you want to check it there, but there may be issues that I have missed with this change.

Pppery (talkcontribs)

It feels utterly stupid to me that we have to add special-case code for Chinese for the generic pattern "show a page in the user language". But whatever. (Not an objection to another admin doing this)

1234qwer1234qwer4 (talkcontribs)
94rain (talkcontribs)

Thanks for proposing this change.

For confirmation, should we replace MediaWiki with the following (by removing sandbox/)?

{{#if:{{#invoke:String|match|s={{int:lang}}|pattern=zh-|plain=true|nomatch= }}<!--IF: Chinese variants
-->|{{Main page/zh}}<!--/zh
-->|{{Main page/{{#ifexist:Template:Main page/{{int:lang}}|{{int:lang}}|en}}}}<!--/language or /en
-->}}{{NOEXTERNALLANGLINKS}}<!--
-- To edit what appears on this page,
-- please see [[Template:Main_page]] 
-- https://www.mediawiki.org/wiki/Template:Main_page
-->

And for Template:Main page, do we just apply the exact same content in Template:Main_page/sandbox?

Reply to "Update for the main page"