Page MenuHomePhabricator

A template transclusion with an HTML comment after the template name cannot be adapted by Content Translation
Closed, ResolvedPublic

Description

To reproduce:

  1. Translate Oakland, California from English to Polish. (Important: When I tested this, I used this revision. See the explanation below.)
  2. Try to adapt the first infobox using the template tool (available starting from this patch; usable at the time of this writing at the cx2 testing site).
  • Observed: the template card says "Infobox settlement (!-- See the table at Template:Infobox settlement for all fields and descriptions of their usage. --) Not available in polski"
  • Expected: the template card is supposed to say "Infobox settlement Miejscowość infobox"

If you try to do the same with the article Hoboken, New Jersey, this will work as expected.

Miejscowość infobox is the template in the Polish Wikipedia that corresponds to Infobox settlement.

Explanation: The article [[Oakland, California]] has an HTML comment immediately after the name of the template in the transclusion:

{{Infobox settlement
<!-- See the table at Template:Infobox settlement for all fields and descriptions of their usage. -->
|name                     = Oakland, California

As opposed to Hoboken, New Jersey:

{{Infobox settlement
|name                     = Hoboken, New Jersey

Tagging Parsoid — I suspect that it's related. If not, please remove the tag.

Probably related: T150476: An HTML comment after a template name in a transclusion appears in VisualEditor's popup

Event Timeline

This isn't a Parsoid issue. The comment is part of the wikitext and is recorded in the data-mw (as the parser tests show). CX should strip them (or use the href component).

This isn't a Parsoid issue. The comment is part of the wikitext and is recorded in the data-mw (as the parser tests show). CX should strip them (or use the href component).

Thanks. Using the href value instead of wt makes sense to me, although we'll have to make sure that we use the correct localized template namespace.

Amire80 triaged this task as Medium priority.Nov 14 2016, 1:08 PM
Pginer-WMF claimed this task.
Pginer-WMF added a subscriber: Pginer-WMF.

Testing the example with the new version shows that the correct template ("Miejscowość infobox") is added. Fields are not copied over because of the lack of template data parameter information, but the right template seems to be found at least.

Screenshot 2019-05-27 at 15.42.46.png (533×1 px, 172 KB)