Page MenuHomePhabricator

MediaWiki:Talkpageheader message does not handle language fallbacks
Open, Needs TriagePublic


OpenStreetMap wiki is trying to setup MediaWiki:Talkpageheader message to show some generic text on all talk pages. This works great if the user language is English, but nothing is shown when the user language as any other language, including variants like en-ca.

For example, this talk page shows a header, but shows no header with ?uselang=en-ca

Event Timeline

Yurik created this task.Feb 28 2019, 6:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 28 2019, 6:02 PM

@Yurik You need to create MediaWiki:Talkpageheader/xx. xx is any language code you want to show this message. For example: en-ca.

Yurik added a comment.EditedMar 1 2019, 4:35 PM

@Yurik You need to create MediaWiki:Talkpageheader/xx. xx is any language code you want to show this message. For example: en-ca.

@A2093064 the whole idea behind fallbacks is to avoid creating 430+ pages (aprox number of currently supported languages). Especially when the content of the message page is not language-specific - instead it is a template that should be the same for all languages. The template internally has a special system for localization based on the current page (in OSM wiki, each page title begins with a language prefix except for English, e.g. Pt:Main page).

@Yurik If there is a default message from, it (eg. MediaWiki:Talkpageheader/xx) will fallback to default message instead of custom message in rootpage (MediaWiki:Talkpageheader). Language fallbacks only works for non-existent messages.

Yurik added a comment.EditedMar 3 2019, 3:18 AM

@A2093064 The talkpageheader message is set to a "-" by default - see code. This seems like a very strange behavior, especially because it makes this message useless for non-WP installations, or for any multi-lingual sites like Commons.

@Yurik This defines that this message exists and is empty by default (like Sitenotice). So language fallback not works. But this design is useful for most of message. If sysop custom a message (in rootpage, in English) but not in some language. Default message is better than custom message (for system interface message instead of notice message).
I still suggest creating 430+ pages as a workaround. You can do that by some tools like bots or AWB. There may not be a lot of pages with the same problem.
I don't know if there is a way to solve your problem at the system level. Maybe need to change the language fallback feature. I am not proficient in this.

Yurik added a comment.Mar 3 2019, 6:03 PM

@A2093064 I think a much more intuitive behavior would be to use the "root" page, e.g. MediaWiki:talkpageheader as a fallback when a language-specific page does not exist, and use /en to override just English -- thus treating /en the same as any other language. Yes, it is possible to run a bot to generate all such pages, but ... ew :)

@Yurik All language-specific pages of MediaWiki:talkpageheader exists. Although they are empty but they exist.

@A2093064 What would happen if you remove all of the language-specific versions (as with Nuke for instance)? Could you then use MediaWiki:talkpageheader for all languages?

@FellTiger Maybe my statement is a bit wrong. There is no revisions on the page. So you can't delete it. But when you view the page, you will see some text from translatewiki instead of noarticletext [1]. This message (from translatewiki) will be displayed instead of the message on root page.
[1] For example, compare these two pages: A and B.