Page MenuHomePhabricator

Image filenames added underscores and span tags in Content Translation
Closed, DuplicatePublic

Description

I brought the article "Tour de Tasmània" from Catalan Wikipedia to English using Content Translation. It includes a series of repeated 'flag' templates to indicate the winners of this cycling race over the years. A section of the original code in Catalan looks like this:

Palmarès

'''Original Tour of Tasmania'''

  • 1930 {{Bandera|Austràlia}} [[Hubert Opperman]]
  • 1933 {{Bandera|Austràlia}} [[Richard Lamb]]
  • 1934 {{Bandera|Austràlia}} [[Richard Lamb]]

But, that same section in the content-translation version looks like this:

Winners

'''Original Tour of Tasmania'''

  • 1930 [[Hubert Opperman]]<span class="mw-image-border"><span>[[File:Flag_of_Australia.svg|link=|22x22px]]</span></span>
  • 1933 [[Richard Lamb]]<span class="mw-image-border"><span>[[File:Flag_of_Australia.svg|link=|22x22px]]</span></span>
  • 1934 [[Richard Lamb]]<span class="mw-image-border"><span>[[File:Flag_of_Australia.svg|link=|22x22px]]</span></span>

A bot has subsequently automatically modified the article to replace the underscores in the filenames with spaces:
https://en.wikipedia.org/w/index.php?title=Tour_of_Tasmania&diff=next&oldid=670690990

Ideally, t system should be able to recognise that {{Bandera|Austràlia}} should convert to {{Flag|Australia}}, but at the least, it should not add in Underscores to filenames/links.
[More complex still, is the fact that the idea template in english wikipedia for this use-case is actually template:flagicon, not template:flag. But that's not the fault of CX!]

Event Timeline

Wittylama assigned this task to Amire80.
Wittylama raised the priority of this task from to Needs Triage.
Wittylama updated the task description. (Show Details)
Wittylama added a project: ContentTranslation.
Wittylama subscribed.
Amire80 triaged this task as Medium priority.
Amire80 set Security to None.
Amire80 added subscribers: santhosh, Amire80.

Thanks, @Wittylama.

@santhosh, this one sounds very similar to T91876, possibly a dupe.

Arrbee raised the priority of this task from Medium to Needs Triage.Oct 29 2018, 1:35 PM
Arrbee moved this task from Bugs to Check & Move on the ContentTranslation board.

When translating "Tour de Tasmània" from ca->en with cx2, there is an attempt to generate a match for the template {{Bandera|Austràlia}} in enwiki although for the translation the 'Source option' was used. The code produced is following:

<a rel="mw:WikiLink" href="https://en.wikipedia.org/wiki/Template:Country_data_Austr%C3%A0lia" title="Template:Country data Austràlia" about="#mwt1" typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Bandera&quot;,&quot;href&quot;:&quot;./Template:Bandera&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;Austràlia&quot;}},&quot;i&quot;:0}}]}" id="mwAg" class="new ve-ce-leafNode ve-ce-mwTransclusionNode ve-ce-focusableNode" contenteditable="false">Template:Country data Austràlia</a>

Although, the issue presents itself differently in cx2, translating templates is still an issue. I merged it with T91876: In ContentTranslation templates in tables are not published as expected.