Page MenuHomePhabricator

"See also" template rendered as an empty line in Section Translation
Closed, ResolvedPublic2 Estimated Story Points

Description

Translating the "Rover and lander specifications" section form the Curiosity (rover) article from English to Thai, there is a See also template that is rendered as an empty line in Section Translation. It can be converted properly into the Thai equivalent template by taping "apply".

However, the expected behaviour would be for the source template to be rendered as it is shown in the source article:

Source article in the browserSection Translation
Screenshot 2022-02-04 at 10.40.12.png (1×619 px, 345 KB)
th.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&page=Curiosity%20(rover)&from=en&to=th&sx=true(iPhone SE).png (1×750 px, 416 KB)

__

The Redirect template seems to have a similar issue (identified as T302978 was reported).

Event Timeline

Pginer-WMF triaged this task as Medium priority.
santhosh set the point value for this task to 2.Apr 5 2022, 6:00 AM

Template:See also and Template:Redirect behave the same in CX too.

This is the HTML generated from Template:See also

<link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1033289096" about="#mwt89" typeof="mw:Extension/templatestyles mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;See also&quot;,&quot;href&quot;:&quot;./Template:See_also&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;Comparison of embedded computer systems on board the Mars rovers&quot;}},&quot;i&quot;:0}}]}" id="mwxg">
<div role="note" class="hatnote navigation-not-searchable" about="#mwt89" id="mwxw">See also: <a rel="mw:WikiLink" href="./Comparison_of_embedded_computer_systems_on_board_the_Mars_rovers" title="Comparison of embedded computer systems on board the Mars rovers">Comparison of embedded computer systems on board the Mars rovers</a></div>

It has the hatnote class for the rendering fragment. As per the filtering rules in cxserver, we remove html elements that are hatnote class because they are meta to the article and not a meaningfully translatable content to another language. But there is a small problem with that removal. Its first fragment - the link tag - remains in the HTML output. That is a fragment without any rendering - This is that empty section we observe in interface.

This kind of issues of appear now and then for cxserver. To remove the link tag here, we need a repeat parsing for the html since they appear before the hatnote fragment. Going back in tree is not possible due to the SAX parser behavior. Repeat parsing has many problems and performance overhead too. In all these cases, the problematic template was added to "Removable templates" configuration and it resolved the issue. We first remove link tag because it has Template:See also, then we see a connected fragment - the <div> tag. We remove that too.

Here also I am tempted to do the same because Template:See alo and Template:Redirect are meta information on the content. A redirect in one wiki cannot be translated to another wiki. A see also link in one wiki will not be available in another wiki. A "see also" fragment with Red link does not make sense. They are not similar to the usual red links in articles.

Change 777739 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/services/cxserver@master] Parser: Remove See also and Redirect templates

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

Here also I am tempted to do the same because Template:See alo and Template:Redirect are meta information on the content. A redirect in one wiki cannot be translated to another wiki. A see also link in one wiki will not be available in another wiki. A "see also" fragment with Red link does not make sense. They are not similar to the usual red links in articles.

Agree. Those templates signal elements that depend on the specific knowledge organization of the wiki. Skipping them makes sense to me. That is, hiding them from the source, to focus the translation on the content elements.

Change 777739 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Parser: Remove See also and Redirect templates

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

Change 777694 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-04-06-080942-production

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

Change 777694 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-04-06-080942-production

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

KartikMistry subscribed.

This is deployed, but somehow message wasn't logged by logmsgbot.

The template seems to be properly skipped. It does not appear at all and cannot be selected. Thus, it does not show as an empty line element as before.

th.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&page=Curiosity%20(rover)&from=en&to=th&sx=true(iPhone SE) (1).png (1×750 px, 468 KB)