Page MenuHomePhabricator

CX2: Wrong template is added despite being connected in Wikidata
Closed, ResolvedPublic

Description

When translating La Mano Negra from Spanish to English, the last reference ([2]) from the first text paragraph is added as a missing red template.

The template used in the original Spanish article is Harvnp which, according to Wikidata its equivalent in English is Sfn. However, when added to the translation, it was added as a missing "Harvnp" instead of the corresponding "Sfn".

Screenshot 2019-02-22 at 11.47.34.png (364×1 px, 156 KB)


Related ticket: T223176: Template {{sfn}} does not produce "template unavailable" warning to a user


The issue was originally reported in this comment

Event Timeline

Note that Plantilla:Sfn is redirect (https://es.wikipedia.org/w/index.php?title=Plantilla:Sfn&redirect=no) in eswiki to Plantilla:Harvnp

Thanks for the observation. So maybe the redirect in the source wiki (Spanish) is causing some confusion in picking the equivalent template for the target language (English)?

Pginer-WMF triaged this task as Medium priority.Feb 25 2019, 8:11 AM

Change 504860 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Handle references that are templates

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

Change 504860 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Handle references that are templates

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

I tested the example above, and the "Harvnp" template is still inserted instead of the corresponding "Sfn" one:

Screenshot 2019-05-31 at 14.03.08.png (482×1 px, 169 KB)

So I'm moving it back to the backlog. But, feel free to undo if some other check is needed before that.

The issue is the same as in T223176: Template {{sfn}} does not produce "template unavailable" warning to a user, e.g. checking in cx2-testing

  • the template is failed to be displayed as as a failed template
  • but the failed template is recognized as a reference nevertheless, and grouped with another reference at the end of the paragraph (a known issue).

This issue and T223176 are duplicate although describe different sides of the issue.

This issue and T223176 are duplicate although describe different sides of the issue.

Thanks Elena. I think it is worth keeping separate tickets since each provides a specific example from a different angle, but I added a note in the description to connect them, and it would be great to check if T223176 gets solved with the fix for this one.

Change 517796 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Annotation mapping: split the words in periods

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

In the master version of cxserver, the issue was not about mapping Harvnp to Sfn, but the translated content did not had any template. The reference link was coming as plain text

Simplified HTML with the issue: Note the Plantilla:Harvnp template

<section id="cxTargetSection2" data-mw-cx-source="undefined">
    <p id="mwDA">La Mano Negra .<sup about="#mwt3" class="mw-ref"
            data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Harvnp&quot;,&quot;href&quot;:&quot;./Plantilla:Harvnp&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;Termes&quot;},&quot;2&quot;:{&quot;wt&quot;:&quot;2011&quot;},&quot;p&quot;:{&quot;wt&quot;:&quot;91&quot;}},&quot;i&quot;:0}}]}"
            id="cite_ref-FOOTNOTETermes201191_2-0" rel="dc:references" typeof="mw:Transclusion  mw:Extension/ref"
            data-ve-no-generated-contents="true"><a href="./La_Mano_Negra#cite_note-FOOTNOTETermes201191-2"
                style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup>

            </p>

        </section>

Translation result:

$ cat bugs/T216809.html | ./bin/translate Apertium es en
translate.Apertium.charcount 25
<section data-mw-cx-source="undefined" id="cxTargetSection2">    <p id="mwDA">The Black Hand .[2]            </p>        </section>

After the fix:

$ cat bugs/T216809.html | ./bin/translate Apertium es en
translate.Apertium.charcount 25
<section data-mw-cx-source="undefined" id="cxTargetSection2">    <p id="mwDA">The Black Hand .<sup about="#mwt3" class="mw-ref" data-cx="[{&#34;adapted&#34;:true,&#34;partial&#34;:false,&#34;targetExists&#34;:true}]" data-mw="{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;Sfn&#34;,&#34;href&#34;:&#34;./Template:Sfn&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Termes&#34;},&#34;2&#34;:{&#34;wt&#34;:&#34;2011&#34;},&#34;p&#34;:{&#34;wt&#34;:&#34;91&#34;}},&#34;i&#34;:0}}]}" data-ve-no-generated-contents="true" id="cite_ref-FOOTNOTETermes201191_2-0" rel="dc:references" typeof="mw:Transclusion  mw:Extension/ref"><a href="./La_Mano_Negra#cite_note-FOOTNOTETermes201191-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup>            </p>        </section>

Note that template is mapped to Sfn and parameters are all mapped.

Change 517796 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Annotation mapping: split the words in periods

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