Page MenuHomePhabricator

CX2: Template appears as regular text in the source document, propagating as HTML into the translation
Closed, ResolvedPublic

Description

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.

This quick link allows to try a translation for an example page which includes two problematic templates (view the result after publishing). Each example is described below.

Commonscat

This example was originally extracted from La Mano Negra. In this case, the template 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 Commonscat for the case of Catalan).

Portal

The other example is from Tumba de corredor en cuña. There the 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 (T225788) 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 Portal for the case of Catalan).


Event Timeline

Pginer-WMF triaged this task as Medium priority.Feb 25 2019, 8:09 AM
Pginer-WMF moved this task from Needs Triage to CX2 on the ContentTranslation board.
Pginer-WMF renamed this task from CX2: Template appears as regular text in the source document to CX2: Template appears as regular text in the source document, propagating as HTML into the translation.Jun 14 2019, 10:08 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF edited projects, added CX-out-of-beta; removed ContentTranslation.

Change 517841 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] WIP Section wrapping improvements

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

check this case once this task is done

Change 517841 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Fixes for section wrapping for a complex case

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

is this deployed in any test environment?
in cx2-testing I still see the issue and on ofb is not totally correct as well

is this deployed in any test environment?
in cx2-testing I still see the issue and on ofb is not totally correct as well

This is deployed on test instances as both cx-ofb and cx2-testing are using same cxserver instance.

This comment was removed by Jpita.