Page MenuHomePhabricator

Content Translation substituted a template with TemplateStyles
Closed, ResolvedPublic

Description

This issue is similar to other cases of Content Translation substituting a reference template with HTML and wiki syntax instead of adapting it to a proper template, but @Pginer-WMF asked to report it separately anyway. If this is not really a distinct issue, feel free to merge it without asking me.

Here is a relatively easy example that I found: A translation of Twyla Tharp into Hebrew. The original revision has this reference:

<ref name=Kourlas2>
  {{cite news
  | last = Kourlas
  | first = Gia
  | title = Twyla Tharp's 50 Years of Forward Movement
  | newspaper = The New York Times
  | date = 4 April 2015
  | url = https://www.nytimes.com/2015/04/05/arts/dance/twyla-tharps-50-years-of-forward-movement.html?ref=dance&_r=0
  | accessdate = 6 April 2015
  | quote =
  }}</ref>

It was adapted to this:

<ref name="Kourlas2">
 <cite class="citation news">Kourlas, Gia (4 April 2015). [https://www.nytimes.com/2015/04/05/arts/dance/twyla-tharps-50-years-of-forward-movement.html?ref=dance&_r=0 "Twyla Tharp's 50 Years of Forward Movement"]. ''The New York Times''<span class="reference-accessdate">. Retrieved <span class="nowrap">6 April</span> 2015</span>.</cite><templatestyles src="Module:Citation/CS1/styles.css"></templatestyles></ref>

I'd expect it to be adapted to something with {{cite news}}, because there is a corresponding template in the Hebrew Wikipedia.

In particular, notice that the blob in the output has a <templatestyles> tag, which really has nothing to do in an article, and should only be used in templates. This is how I noticed this issue: The Hebrew Wikipedia has an Abuse Filter that doesn't allow new users to use this tag in articles.

There are several other examples, including at least one that is currently in progress and cannot be published because of the AbuseFilter.

Event Timeline

Another example:

A translation of Eva Marian Hubback from English into Hebrew: אווה מריאן האבאק.

If you examine the wiki text source, you'll see a lot of <ref>s with <templatestyles> tags.

I reported another case at T233085: Language templates causing problems in both the source and translation that may be related. The "templatestyles" element appears too, but in this case it appears in the source document and causes the contents after it on the initial translation to get lost.

The adaptation happened correctly, but the en.wiki reference content has a te mplate style. - https://en.wikipedia.org/wiki/Module:Citation/CS1/styles.css. The templatestyle does not exist in he.wikipedia and MW parser is throwing that error in article page. yi and kab languages have corresponding template styles. To make it clear a ref with templatestyle is a valid markup. it becomes problematinc only when that template style does not exist in target wiki

<cite class="citation news" id="mwAXg">Kourlas, Gia (4 April 2015). <a class="external text" href="https://www.nytimes.com/2015/04/05/arts/dance/twyla-tharps-50-years-of-forward-movement.html?ref=dance&amp;_r=0" id="mwAXk" rel="mw:ExtLink">"Twyla Tharp's 50 Years of Forward Movement"</a>. <i id="mwAXo">The New York Times</i><span class="reference-accessdate" id="mwAXs">. Retrieved <span class="nowrap" id="mwAXw">6 April</span> 2015</span>.</cite><link about="#mwt199" data-mw="{&quot;name&quot;:&quot;templatestyles&quot;,&quot;attrs&quot;:{&quot;src&quot;:&quot;Module:Citation/CS1/styles.css&quot;},&quot;body&quot;:{&quot;extsrc&quot;:&quot;&quot;}}" href="mw-data:TemplateStyles:r886058088" id="mwAX4" rel="mw-deduplicated-inline-style" typeof="mw:Extension/templatestyles">

This one is valid markup. This is from en.wiki. Our cxserver code does not touch this at all while adapting since this is not a template. It is cite extension. When you use this citation in he.wiki, it works fine, except, Module:Citation/CS1/styles.css does not exist there.

Change 537982 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Do not include template styles in the content to translate

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

Change 537982 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Do not include template styles in the content to translate

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

Change 539520 had a related patch set uploaded (by KartikMistry; owner: KartikMistry):
[operations/deployment-charts@master] Update cxserver to 2019-09-26-034732-production

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

Change 539520 merged by jenkins-bot:
[operations/deployment-charts@master] Update cxserver to 2019-09-26-034732-production

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