Page MenuHomePhabricator

Sitenotices are not language-converted for every variant due to caching
Open, MediumPublic

Description

As reported at https://zh.wikivoyage.org/wiki/Wikivoyage:%E4%BA%92%E5%8A%A9%E5%AE%A2%E6%A0%88#.E4.B8.8A.E9.9D.A2.E7.9A.84.E5.91.8A.E7.A4.BA.E6.B2.92.E6.9C.89.E8.BD.89.E6.8F.9B.E6.AD.A3.E3.80.81.E7.B0.A1.E9.AB.94.E4.B8.AD.E6.96.87 , even if the user language and user language variant are changed, sitenotice still appears to be the same:

After some research, I've found out that in https://github.com/wikimedia/mediawiki-core/blob/6f022809880ed9ae330045b76723f9d14601916e/includes/Skin.php#L1552 , $needParse partly depends on whether [[MediaWiki:Sitenotice]] was actually changed. However, language converter works within the parser, which means that even if the wikitext was the same, after parsing, the text could actually change. It is recently that the variant of the cached version changed from zh to zh-tw, and some non-hant users have found that the sitenotice became unreadable for them.

As shown in https://github.com/wikimedia/mediawiki-core/blob/6f022809880ed9ae330045b76723f9d14601916e/includes/Skin.php#L1549 , a change to $wgRenderHashAppend (which defaults to '') could re-parse the page.
And due to above issues, I propose to append the variant name $wgRenderHashAppend while processing sitenotice.


Version: 1.24rc
Severity: normal
URL: https://zh.wikivoyage.org/

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:30 AM
bzimport set Reference to bz69279.
bzimport added a subscriber: Unknown Object (MLST).

Change 156026 had a related patch set uploaded by Zhuyifei1999:
Add language code to sitenotice cache key

https://gerrit.wikimedia.org/r/156026

Change 156026 abandoned by Zhuyifei1999:
Add language code to sitenotice cache key

https://gerrit.wikimedia.org/r/156026

This isn't a problem with BagOStuff, MessageCache or ParserCache itself. MediaWiki-Cache is not a general tag for anything relating to cache. For that we have a search engine that takes keywords.

Change 737449 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Apply LanguageConverter on the site notice and cache them by language separately

https://gerrit.wikimedia.org/r/737449

I found my patch is suitable for this task, though wmf wikis seem don't need the sitenotice provided by core now...

But I think it is still helpful for 3rd party wikis if we can fix this.