Page MenuHomePhabricator

Make it possible to transfer parameters to the commons information template that are specific to a wiki
Open, Needs TriagePublic8 Estimated Story Points

Description

Motivation

Ideas

  • Since this field needs to be filled with a special template[1], the information form the source can only be kept, when an extension of the original parameter value is possible. For that we would need to support a more complex way to parse and transfer templates and values.

Example:

{{Information|
Anmerkung = das Bild wurde mit einer Drohne aufgenommen
}}

could become

{{Information|
Other fields = {{Information field | Name = Remarks | Value = das Bild wurde mit einer Drohne aufgenommen}}
}}

[1] https://commons.wikimedia.org/wiki/Template:Information_field

Acceptance Criteria

  • It should be possible to define in the config file which other parameters are also allowed in the information template
    • We should be able with translating the parameter name to a Commons equivalent, and with adding the content to that new name, allowing users to wrap this in their language ("@")
    • These parameters should be shown as last info of the information template, but multiple parameters can be shown in one row.
  • When at least one such parameter exists, it should be transfered to Commons (if the config file has been set up)
  • If no extra parameter exists, no extra line is added
  • If one of the defined parameters is empty it might just be removed
  • In this version, only the information template is affected. Please add a note TODO ask @JStrodt_WMDE to formulate once the syntax is clear, but make sure that information template only is mentioned

Notes

Where this request was mentioned

Event Timeline

Just to clarify, the way you use "subst:" is that you first set up translation template. For example c:Template:Изображение is used to map fields from :ru:Шаблон:Изображение to c:Template:Information, so that during transfer people can just replace "Изображение" in the template with "subst:Изображение" and that template is replaced with "Information" template with all the fields mapped from one template to the other. That mechanism also allows: working with different aliases of the field names in the source template, mapping multiple fields into one, adding language templates, etc.

Another example is c:Template:Зображення created in 2008 to map from :uk:Шаблон:Зображення to c:Template:Information.

Change 485761 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Allow to use subst:… in template transfer rules

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

JStrodt_WMDE renamed this task from Allow "subst:" in {{tl|Information}} template configuration to Allow merging of multiple source parameters into one Commons parameter.Jan 24 2019, 9:23 AM
JStrodt_WMDE updated the task description. (Show Details)

Just to clarify, the way you use "subst:" is that you first set up translation template. For example c:Template:Изображение is used to map fields from :ru:Шаблон:Изображение to c:Template:Information, so that during transfer people can just replace "Изображение" in the template with "subst:Изображение" and that template is replaced with "Information" template with all the fields mapped from one template to the other. That mechanism also allows: working with different aliases of the field names in the source template, mapping multiple fields into one, adding language templates, etc.

Another example is c:Template:Зображення created in 2008 to map from :uk:Шаблон:Зображення to c:Template:Information.

Thanks, @Jarekt, for the explanation!

Change 485761 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Allow to use subst:… in template transfer rules

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

thiemowmde subscribed.

For your information: We realized that that a transfer rule containing subst:Изображение would trigger a bug in FileImporter. The template name after the colon would get lost and the resulting wikitext would contain something like {{subst|…}}. The bugfix https://gerrit.wikimedia.org/r/485761 should go live on February 5th.

Note the bugfix alone will not automatically solve this ticket. But it opens one possibly way (kindly described by @Jarekt above) how the communities can deal with the situation. @Jarekt, can you please let us know if this helps?

Lea_WMDE renamed this task from Allow merging of multiple source parameters into one Commons parameter to Make it possible to transfer parameters to the commons information template that are specific to a wiki.Jun 3 2019, 1:03 PM
Lea_WMDE updated the task description. (Show Details)
Lea_WMDE set the point value for this task to 8.

Change 519624 had a related patch set uploaded (by Jkroll; owner: Johannes Kroll):
[mediawiki/extensions/FileImporter@master] [WiP] Make it possible to transfer wiki-specific template parameters

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

awight added subscribers: jkroll, awight.

Grabbing this task until July 10th.

I'm thinking about the config syntax, here's a line from the current de.wikipedia.org configuration:

Information|@Description=Beschreibung|@Source=Quelle|Author=Urheber|Date=Datum|Permission=Genehmigung|other_versions=Andere Versionen

We can stay pretty close to the existing syntax, but instead of mapping template parameters to a new template parameter, we would be mapping a template parameter to an ad-hoc Name label, if a new character e.g. & is present. So for example, the task description's rule would become,

Information|@Description=Beschreibung|@Source=Quelle|Author=Urheber|Date=Datum|Permission=Genehmigung|other_versions=Andere Versionen|@&Remarks=Anmerkung

Multiple punctuation is unfortunate.

Change 520426 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] [WIP] new "&" symbol for configuring extra parameters

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

awight moved this task from Doing to Sprint Backlog on the WMDE-QWERTY-Sprint-2019-06-26 board.

I'm thinking about the config syntax, here's a line from the current de.wikipedia.org configuration:

Information|@Description=Beschreibung|@Source=Quelle|Author=Urheber|Date=Datum|Permission=Genehmigung|other_versions=Andere Versionen

We can stay pretty close to the existing syntax, but instead of mapping template parameters to a new template parameter, we would be mapping a template parameter to an ad-hoc Name label, if a new character e.g. & is present. So for example, the task description's rule would become,

Information|@Description=Beschreibung|@Source=Quelle|Author=Urheber|Date=Datum|Permission=Genehmigung|other_versions=Andere Versionen|@&Remarks=Anmerkung

Multiple punctuation is unfortunate.

@awight Can you let me know when the syntax is final? That's when I jump in to provide the text.

@Lea_WMDE I'm currently expecting to drop this from the sprint, rather than do half the job... Let me know what you think.

Change 519624 abandoned by Thiemo Kreuz (WMDE):
[WiP] Make it possible to transfer wiki-specific template parameters

Reason:
To be honest it doesn't look like there is anything in this draft we can use when we start working on this task again.

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

Change 520426 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/FileImporter@master] [WIP] new "&" symbol for configuring extra parameters

Reason:

Unfortunately there is no test case that would demonstrate how the proposed `&` prefix would behave. It looks like we don't really loose anything when we close this. The community solved the problem with subst:… templates that contain the mapping logic.

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