Page MenuHomePhabricator

LivePreview: Page heading for "Creating" should support parser functions
Closed, DeclinedPublic

Description

Steps to reproduce:

The reason is in https://de.wikipedia.org/wiki/MediaWiki:Creating. It contains

{{„}}{{{1|$1}}}{{“}} – Erstellen

and mw.msg from https://gerrit.wikimedia.org/r/182780 and https://gerrit.wikimedia.org/r/187710 does not support expansion of templates and the template are not on client side.

The best solution would be a possibility to use messages that gets expanded on server side.

Currently

		'messages' => array(
			'creating',
		)

sets mw.messages.set( 'creating', '{{„}}{{{1|$1}}}{{“}} – Erstellen' ). For expanded messages a new ResourceLoader module would be necessary:

		'expandedmessages' => array(
			'creating',
		)

sets mw.messages.set( 'creating', '„$1“ – Erstellen' ).

Event Timeline

Fomafix raised the priority of this task from to Needs Triage.
Fomafix updated the task description. (Show Details)
Fomafix added a subscriber: Fomafix.
matmarex added a subscriber: matmarex.

VisualEditor has the same problem: https://de.wikipedia.org/w/index.php?title=New_page&veaction=edit&uselang=de

I could swear this is already reported (in context of VE or LivePreview or both), but I can't find the bug with the useless search Phabricator has.

THERE it is: T51951. (Tip: just view the list of all the thousands bugs in relevant projects, and use browser search. Saves time and annoyance.)

Krinkle renamed this task from LivePreview: Wrong firstHeading in preview of new pages on dewiki with German user interface language to LivePreview: Page heading for "Creating" should support parser functions.Apr 10 2015, 6:38 PM

This and T51951 are wontfix. These localisation messages should not use parser functions. This was never intentionally supported and whatever localisation needs exist in German that need this should be filed as a separate task against MediaWiki core to find a way to support that.

Complex parser functions will not be supported in this interface message.

We've previously helped de.wikipedia.org migrate the "Editing" message (See https://de.wikipedia.org/w/index.php?title=MediaWiki:Editing&action=history), we can do the same for the "Creating" message.

I agree with Krinkle on this. It's one more example of our non diligence in letting template parsing creep into many parts of the 'chrome' of the site. We are actively trying to get away from that, we shouldn't add more hacks to support it.

Krinkle claimed this task.

I've fixed the message on de.wikipedia.org.

See also https://de.wikipedia.org/wiki/MediaWiki_Diskussion:Editing#Parse_issue.

matmarex changed the task status from Resolved to Declined.Apr 13 2015, 9:33 PM

(If they're wontfix, then let's decline them.)

Decline is comprehensible. The templates are used for localization. This should be done on creating the messages not on reading the messages. Especially because of performance.

But now there is a inconsistency. Messages on client side do not expand templates and messages on server side expand templates. Should the expanding of templates on server side be removed?

Server side expansion would also be useful for {{int:...}} expansion instead of https://gerrit.wikimedia.org/r/113918 .

A syntax extension like

		'messages' => array(
			'creating' => array( 'parse' => 'foo' ),
		)

would be better.

If messages should conceptually be different based on certain conditionals, such feature should be implemented as part of the software (with different messages for each), not as part of a local translation override. That's not what the localisation system is for and is subsequently not supported.

It works PHP renderings because the message parser is shared with that of advanced templates and such.

[..] inconsistency. Messages on client side do not expand templates and messages on server side expand templates. Should the expanding of templates on server side be removed?

That would be interesting to consider.