Page MenuHomePhabricator

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

Assigned To
Authored By
Pginer-WMF
Feb 22 2019, 11:29 AM
Referenced Files
F29868581: image.png
Jul 25 2019, 6:37 AM
F29813052: image.png
Jul 19 2019, 4:48 PM
F29639564: image.png
Jun 25 2019, 8:12 AM
F29531670: Screenshot 2019-06-14 at 12.01.01.png
Jun 14 2019, 10:08 AM
F29531074: Screenshot 2019-06-14 at 11.43.25.png
Jun 14 2019, 10:08 AM
F29531213: Screenshot 2019-06-14 at 11.47.31.png
Jun 14 2019, 10:08 AM
F29531666: Screenshot 2019-06-14 at 12.02.02.png
Jun 14 2019, 10:08 AM
F28263222: Screenshot 2019-02-22 at 12.25.16.png
Feb 22 2019, 11:29 AM

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):

Screenshot 2019-06-14 at 11.43.25.png (218×1 px, 44 KB)

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:

Screenshot 2019-06-14 at 11.47.31.png (171×648 px, 40 KB)

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:

Screenshot 2019-06-14 at 12.02.02.png (264×928 px, 77 KB)

In Visual editor, the template is labelled as "transclusion" but still selected as a unit:

Screenshot 2019-06-14 at 12.01.01.png (212×788 px, 36 KB)

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

image.png (766×914 px, 279 KB)
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

image.png (482×942 px, 148 KB)

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

image.png (482×942 px, 148 KB)

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

This comment was removed by Jpita.