Page MenuHomePhabricator

MediaWiki:Templatesusedpreview is not parsed in Realtime Preview
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

grafik.png (263×1 px, 27 KB)

The following wikitext from https://de.wikipedia.org/wiki/MediaWiki:Templatesusedpreview is not parsed:

{{PLURAL:{{{1|$1}}}|Die folgende [[Hilfe:Vorlagen|Vorlage]] wird|Folgende [[Hilfe:Vorlagen|Vorlagen]] werden}} von dieser {{#ifeq:{{NAMESPACE}}|{{ns:0}}|Artikelvorschau|Seitenvorschau}} verwendet:

What should have happened instead?:

The MediaWiki message should be parsed.. Compare with editing without live preview.

Other information (browser name/version, screenshots, etc.):
Maybe related to T321032 - When using preview, the edit link and protection status is lost in "Template used in this preview"

Event Timeline

With JS disabled, the message shown is parsed, but is "Folgende Vorlagen werden von diesem Artikel verwendet:" — which doesn't seem to be either the one given above, or the default for templatesusedpreview. (Or am I just looking at it wrongly?)

Anyway, it looks like the issue is with JS parsing the message. This works:

{{PLURAL:$1|Template|Templates}}

and this doesn't:

{{PLURAL:{{{1|$1}}}|Template|Templates}}

Why is there a template variable there? Is that so this message can be transcluded in the wiki?

With JS disabled, the message shown is parsed, but is "Folgende Vorlagen werden von diesem Artikel verwendet:" — which doesn't seem to be either the one given above, or the default for templatesusedpreview. (Or am I just looking at it wrongly?)

Anyway, it looks like the issue is with JS parsing the message. This works:

{{PLURAL:$1|Template|Templates}}

and this doesn't:

{{PLURAL:{{{1|$1}}}|Template|Templates}}

Why is there a template variable there? Is that so this message can be transcluded in the wiki?

I think for the German language variants de-at, de-ch, and de-informal.

Before writing this task I tried a more simple version

{{PLURAL:$1|Die folgende [[Hilfe:Vorlagen|Vorlage]] wird|Folgende [[Hilfe:Vorlagen|Vorlagen]] werden}} von dieser {{#ifeq:{{NAMESPACE}}|{{ns:0}}|Artikelvorschau|Seitenvorschau}} verwendet:

without success. Still not parsing.

{{PLURAL:}} is supported by mediawiki.jqueryMsg, but not {{#ifeq:}}, remove that part and plural works (at least locally).

Not sure if the message is returned as plain, when one parser function cannot be expanded, but it looks like that.

I edited the local messages; don't know if jqueryMsg getting enhanced is likely, if not the task could be closed.

Thanks @hgzh! I don't think it's likely that jqueryMsg will ever get support for other parser functions.

(But {{PLURAL:}} works, if you're like to use it in the translation.)