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 fo the references they need to fill manually and the generation of empty references (and the associated work to clean them) will be avoided.
# 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.
{F25525228, size=full}
For the case of the 4th reference an empty [[ https://ca.wikipedia.org/wiki/Plantilla:London_Gazette | London Gazzete template ]] was created, which includes a warning message in its rendering when there are mandatory parameters missing:
|{F25525271}|{F25525274}|
The other empty references (2nd, 3rt, and 5th) were using the [[ https://ca.wikipedia.org/wiki/Plantilla:Ref-not%C3%ADcia | Ref Notícia template ]], which is the equivalent to the corresponding [[ https://en.wikipedia.org/wiki/Template:Cite_news | 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).
{F25525282}
After manually filling the parameters the list of references looked as shown below, which is the expected result:
{F25525446, size=full}
# Proposed solution
The proposed solution combines the following ideas:
- Represent the unadapted reference in grey (similar to unadapted links, T193233).
-- If the user adds information to them, they will be rendered normal (blue).
- Show a warning to communicate the reference content could not be adapted. Similar to T192271, but customising the text for this specific case:
> **Missing reference**
>
> 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.
>
> You can also improve the template metadata to enable automatic mappings for these templates in the future.
>
> [Learn more]
- "Learn more" will link to the user documentation help page describing how to work with references.
- "Adjust template metadata" will lead the user to the page to edit templateData information.
- When publishing the translation, the missing references will be skipped:
-- References with empty templates that could not be adapted properly, and resulted in empty templates won't be included in the published article in any case if they are still empty at the time of publishing.
-- Templates partially adapted where some parameters were mapped, but other parameters could not, will only be published if the user marked the issue as resolved or the user edits the reference to add information.
{F25677392, size=full}