CX2: Communicate template exists in the target wiki but mapping could not be completed
Open, HighPublic

Description

When a template (block or in-line) is adapted, sometimes it is possible to find the equivalent one in the target wiki (thanks to Wikidata), but it may not be possible to map their parameters (because of the lack of templateData, or parameter aliases/names not matching). As part of the effort to communicate adaptation problems with templates (T192271), we want to communicate this better.

For cases where it is not possible to map the parameters, we want to let the user know that the adaptation process was completed only partially.

For example, when translating Tokyo from English to Spanish, adding the infobox with the city information (based on Infobox settlement template) results in an empty template (using Ficha de localidad template), with no warning or further explanation of what went wrong.

Proposed solution

We want to show a warning when:

  • The target template is found, and no parameter could be transferred to the target template.
  • The target template is found and some parameters could be transferred but there are still empty fields which are marked as mandatory in the target template.

Each case will have a slightly different message:

Empty template

The target template gets added, and a warning encourage the user to complete the missing parameters:

Incomplete template
The information on the original template could not be transferred to the template in the translation since their structure is a bit different.
Please, edit the template in the translation to fill the missing information.

  • "Learn more" will direct the user to the corresponding point of the user documentation.
  • "Edit template" will open the template editing dialog (in the same way as the "edit" button on the template card would do)

Missing mandatory parameters

Incomplete template
A template was added without some required information.
The missing details could not be obtained automatically from the original reference since their structure is a bit different.
Please, edit the template in the translation to fill the missing information.

  • "Learn more" will direct the user to the corresponding point of the user documentation.
  • "Edit template" will open the template editing dialog (in the same way as the "edit" button on the template card would do)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptWed, Nov 14, 11:40 AM

This require additional adaptation information passed from cxserver. I will work on that part.

Change 475312 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Templates: If not all mandatory params are mapped, add partial=true

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

I am looking for a real example where cxserver could not map mandatory params.

Pginer-WMF raised the priority of this task from Normal to High.Mon, Nov 26, 10:50 AM

Notes for front end changes:

cxserver passes the following additional information about Template adapatation status in data-cx

valueTrueFalse
adaptedif the target template exist and some params are adapted.If target template does not exist OR if none of the source params were mapped, when source has atleast one param to map
partialIf some mandatory source params are not mapped.If all mandatory params mapped
targetExistsIf target template exist.if target template does not exist

Change 475312 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Templates: Pass additional data about adaptation status

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

Etonkovidova added a subscriber: Etonkovidova.EditedFri, Dec 7, 12:30 AM

(1) 'Incomplete template' warning seems to be reserved for those rare cases when a target template matches a source template but cannot be mapped - entirely or partially.

@santhosh It seems that the following case is not possible.

Incomplete template
A template was added without some required information.[..]

If mandatory field(s) are failed to be mapped from the source template, the template will be marked as unavailable. Please correct me if I am wrong.

(2) The matched template exists in Catalan - Template:Infobox settlement, but when translating from English-> Catalan, 'Tokyo', the 'Template unavailable' message is displayed. Is it a plain bug for this specific case or, in this case, mapping was not possible despite that the template is present in the target language?


@Pginer-WMF - please review the following cases (outside of this task scope) if they require some follow ups:
(3) There are cases when only required parameter in source template is mapped, so a user sees only a partially adopted template without any warning

(4) Another case of partially adopted template (no additional communication to users).

(2) The matched template exists in Catalan - Template:Infobox settlement, but when translating from English-> Catalan, 'Tokyo', the 'Template unavailable' message is displayed. Is it a plain bug for this specific case or, in this case, mapping was not possible despite that the template is present in the target language?

My guess is that the issues of T204937 are getting in the way here. T204937 was supposed to remove the template only when the template in the target language was not found, but currently removes the template also when there is not info to map the parameters, which is wrong and is in the process of fixing. @santhosh may correct me or expand on this.

@Pginer-WMF - please review the following cases (outside of this task scope) if they require some follow ups:
(3) There are cases when only required parameter in source template is mapped, so a user sees only a partially adopted template without any warning

Source and target templates may have a different structure, and there is no way to know if all the parameters in the source are expected to be transferred in the target. For example, a source template may have two parameters (e.g., "name" and "surname"), and the target template just one (e.g., "full name").

For this ticket we are focusing on the cases where there is a high certainty that there is a problem: the target template has mandatory parameters that have not been filled in, or is completely empty. Both provide undesirable results that make the content look broken. Other cases just lead to incomplete information, that the user can expand. We can consider better supporting those cases too in the future (being careful of not increasing false positives), but those would be out of the scope of the current ticket.

Thanks, @Pginer-WMF - I completely agree

For this ticket we are focusing on the cases where there is a high certainty that there is a problem: the target template has mandatory parameters that have not been filled in, or is completely empty

I guess that T204937 is, in fact, a real blocker for this task.

@santhosh - do you know of some cases when mandatory parameters were not mapped but others mapped? Or about the way to trigger it for testing?