Page MenuHomePhabricator

CX2: Guidance for inline templates with unnamed parameters
Open, MediumPublic

Description

Content Translation tries to transfer templates from the original article into the translation by (a) looking for the equivalent template using Wikidata, (b) mapping the parameters between the templates, and (c) communicating any issues that prevent to complete the process (T192271).

For the case of inline templates with unnamed parameters, it is possible that the corresponding templates have the same number of parameters but in a different order. This results in the adaptation process to complete apparently successfully, but the template not rendering the expected result.

In the example below, the Age template was adapted from English ({{age|year|month|day}}) into the corresponding Spanish template Edad, where a different order was expected in the parameters ({{edad|day|month|year}}). As a result, the template in the translation displays an error message, but since the error message is displayed as content it cannot be detected by Content Translation as an error.

2018-07-31 09.43.52.jpg (252×967 px, 44 KB)

Users are able to edit the problematic template and change the values for the different parameters:

2018-07-31 09.43.59.jpg (535×1 px, 45 KB)

Apart from improving the way templates can communicate their rendering errors (something that may be of interest for the Parsing-Team--ARCHIVED), we can consider providing additional information/options for inline templates with unnamed parameters considering these have a higher risk of being wrongly adapted.

Possible solutions to be explored.

Event Timeline

@ssastry, @cscott, I mentioned in this ticket the possibility for templates to better surface their errors in a way that tools using them could be aware of them. I'm not sure if this is something that the Parsing-Team--ARCHIVED can do anything about or has plans for working on related areas. If you have any relevant information in this regard, feel free to share. Thanks!

Pginer-WMF triaged this task as Medium priority.Jul 31 2018, 8:08 AM

The template is generating the error message ... hence it is content. We haven't considered this before, but, we should probably expose an API (parser function?) that templates can use to expose errors that are then rendered in a standardized way that clients can inspect and act upon.

Thanks for the details, @ssastry. I'm happy to hear this seems a valid usecase. We'll be very interested in hearing about any work considered for this area in the future. So do not hesitate to ping us when the time comes.