Page MenuHomePhabricator

pageinfo-footer message in other language falls back to default English message instead of overridden / database English message
Closed, ResolvedPublic

Description

Compare:

In English, there are “External tools” and “Alternate views” sections at the bottom, which are missing in French. Those sections are added by the local version of MediaWiki:Pageinfo-footer, and it seems that the French version of that message falls back to the default from en.json (“-”, disabled) rather than to the overridden English message from the MediaWiki namespace:

lucaswerkmeister-wmde@mwdebug1002:~$ mwscript shell.php wikidatawiki
Psy Shell v0.10.4 (PHP 7.2.31-1+0~20200514.41+debian9~1.gbpe2a56b+wmf1 — cli) by Justin Hileman
>>> wfMessage( 'pageinfo-footer' )->inLanguage( 'en' )->text()
=> """
   ==External tools==\n
   \n
   * [//pageviews.toolforge.org?project=wikidata.org&pages=Special:Badtitle/Parser Pageviews Analysis]\n
   \n
   <div style="float:right; font-size:95%;">[[Special:EditPage/MediaWiki:Pageinfo-footer|edit]]</div>
   """
>>> wfMessage( 'pageinfo-footer' )->inLanguage( 'fr' )->text()
=> "-"

This also affects other wikis, e. g.:

On the other hand, on commonswiki, gsw and bar seem to correctly fall back to MediaWiki:Pageinfo-footer/de.

Event Timeline

Apparently, that “-” is somewhere in the LocalisationCache:

lucaswerkmeister-wmde@mwdebug1002:~$ mwscript shell.php wikidatawiki
Psy Shell v0.10.4 (PHP 7.2.31-1+0~20200514.41+debian9~1.gbpe2a56b+wmf1 — cli) by Justin Hileman
>>> $lc = MediaWiki\MediaWikiServices::getInstance()->getLocalisationCache()
=> LocalisationCache {#614}
>>> $lc->getSubitem( 'fr', 'messages', 'pageinfo-footer' )
=> "-"

Which, if I understand the caching documentation correctly, means that MessageCache (sitting on top of the LocalisationCache) can’t detect that it should fall back to the English message.

And the underlying l10n cache files seem to contain the message as well:

lucaswerkmeister-wmde@mwdebug1002:~$ grep pageinfo-footer /srv/mediawiki/php-1.35.0-wmf.39/cache/l10n/*fr.*
/srv/mediawiki/php-1.35.0-wmf.39/cache/l10n/fr.l10n.php:	'messages:pageinfo-footer' => '-',
/srv/mediawiki/php-1.35.0-wmf.39/cache/l10n/fr.l10n.php:				24003 => 'pageinfo-footer',
Binary file /srv/mediawiki/php-1.35.0-wmf.39/cache/l10n/l10n_cache-fr.cdb matches

So it looks like we’re already applying language fallbacks when building the l10n cache, and that probably shouldn’t happen?

Please confirm whether this is still an issue:

Change 924137 merged by jenkins-bot:

[mediawiki/core@master] LocalisationCache: Preserve fallback source language info

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

Seems to be resolved AFAICT. Thanks!