Some templates are loaded into the source document as their rendered contents, no longer being a proper template. For example, a template that links to Commons is no longer represented as a template but becomes an image, a link and some text instead. Losing the template structure is especially problematic when this content is added to the translation since unnecessary HTML and missing links are produced.
[[ https://ca.wikipedia.org/wiki/Special:ContentTranslation?title=Especial:Traducci%C3%B3n_de_contenidos&campaign=contributionsmenu&to=ca&page=Usuario%3ACXTests%2FT216812&from=es&targettitle=Usuari:CXTests/published/T216812 | This quick link ]] allows to try a translation for [[ https://es.wikipedia.org/wiki/Usuario:CXTests/T216812 | an example ]] page which includes two problematic templates (view [[ https://ca.wikipedia.org/wiki/Usuari:CXTests/published/T216812 | the result after publishing ]]). Each example is described below.
This example was originally extracted [[ https://es.wikipedia.org/wiki/La_Mano_Negra#Enlaces_externos | from La Mano Negra ]]. In this case, the template [[ https://es.wikipedia.org/wiki/Plantilla:Commonscat | Commonscat ]] which links to a related Commons category is no longer presented as a template. Each of the elements that form the rendered version of the template are added as independent elements (image, link, text):
However, when the page is edited with Visual Editor the elements are represented as a unit. this unit is labelled as a transclusion, but there the image, link and text are not represented as separate elements:
The expected result would be for the template to be added as a template in the source document, and then transferred as the equivalent template in the target language (also named [[ https://ca.wikipedia.org/wiki/Plantilla:Commonscat | Commonscat ]] for the case of Catalan).
The other example is from [[ https://es.wikipedia.org/wiki/Tumba_de_corredor_en_cu%C3%B1a | Tumba de corredor en cuña ]]. There the [[ https://es.wikipedia.org/wiki/Plantilla:Portal | Portal ]] template is also represented in the source document no longer as a template, but the individual HTML elements of its rendering instead. In the example below, notice how individual elements like a link can be selected instead of the template as a whole:
In Visual editor, the template is labelled as "transclusion" but still selected as a unit:
In this particular case, another bug seems to expand the selection to the list of links below it too for Visual editor, and that may be causing that the links below don't get adapted properly in Content translation.
The expected result would be for the template to be added as a template in the source document, and then transferred as the equivalent template in the target language (also named [[ https://ca.wikipedia.org/wiki/Plantilla:Portal | Portal ]] for the case of Catalan).
- This issue was originally reported [[ https://www.mediawiki.org/wiki/Topic:Uugrb0n7muibs6hv | in this comment ]]