References content is often formed by a template that gives structure to the data. Mapping these templates across languages is not always easy since these templates may be different in each language, and they may lack templateData (T200314) to map their parameters between the equivalent templates.
In general, we want to communicate when templates cannot be mapped (T192271), but the particular case of templates in references may need special attention. This case is especially relevant since (a) references are important in Wikipedia, (b) issues adapting them are easy to miss for translators if they don't open them and check their details, and (c) becomes complex to fix afterwards.
This ticket proposes to explore ways in which references for which their content template is not properly mapped can be (a) highlighted to the user and (b) skipped from the final article if it does not get fixed. In this way, users will be aware of the references they need to fill manually and the generation of empty references (and the associated work to clean them) will be avoided.
This ticket focuses on cases where the reference template could not be adapted at all, resulting in an empty reference (if the target template could not be found), or a reference with an empty template (if parameters could not mapped for the target template).
Example of the issue
When translating "Jony Ive" from English to Catalan. The resulting list of references showed references 2nd, 3rd, and 5th as empty (" .") and the 4th showing a warning message:
The problem in both cases was the same. Content translation generated a reference, and mapped the template to the equivalent one, but could not map the parameters due to the lack of templateData. As a result, an empty template was generated.
For the case of the 4th reference an empty London Gazzete template was created, which includes a warning message in its rendering when there are mandatory parameters missing:
The other empty references (2nd, 3rt, and 5th) were using the Ref Notícia template, which is the equivalent to the corresponding Cite News template in the original English article. The reference created by Content Translation also resulted in a template with no parameters, which in this case just renders as " ." (a space plus a dot).
After manually filling the parameters the list of references looked as shown below, which is the expected result:
The proposed solution combines the following ideas:
- Represent the unadapted reference in grey (similar to unadapted links, T193233).
- If the user adds information to the reference (or the template it contains), it will be rendered normal (blue) and the warning will disappear.
- Show a warning to communicate the reference content could not be adapted. Similar to T192271, but customising the text for this specific case:
A reference could not be transferred to the translation since it uses a template with a different structure.
Please, edit the reference in the translation to fill the missing information.
- "Learn more" will link to the user documentation help page describing how to work with references.
- "Replace with a new citation" will open the new citation dialog (in the same way as if the user clicked on "Cite"), to allow inserting a new citation that will replace the missing reference.
- When publishing the translation, the missing references will be skipped if they are still empty or contain only an empty template. That is, for cases where the reference is still marked as missing (grey) and the user has not edited it.
This ticket focuses on cases where the reference template could not be adapted at all, resulting in an empty reference (if the target template could not be found), or a reference with an empty template (if parameters could not mapped for the target template).For references with partially adapted templates, there is a relevant ticket: T206310: CX2: Highlight references with a template that is missing mandatory parameters after being adapted