Page MenuHomePhabricator

CX2: Citations templates are sometimes translated to useless markup (or empty) without content
Closed, ResolvedPublic

Description

To reproduce:

  • Translate "Jerusalem Calling" from Hebrew to any language (I tried Ukrainian).
  • Click the first paragraph that has a footnote in it.
  • Publish the article.

Expected: The footnote must be translated to a <ref> tag with sensible content.
Observed: The footnote is translated to <span class="mw-ref" id="cxcite_ref-1" rel="dc:references">[[#cite_note-1|<span class="mw-reflink-text"><nowiki>[1]</nowiki></span>]]</span><span class="mw-ref" id="cxcite_ref-1" rel="dc:references"></span>. This is useless markup, which seems to be related to citations and CX, but doesn't have any of the useful reference content, and there's nothing to do with it except to delete it.

I saw similar things in dozens of published translation, but never bothered to create a proper task. Thanks to @IKhitron for this focused example. (Also, there's a chance that this was already in one of @santhosh's recent template adaptation fixes, which weren't deployed yet, but it may also be a newly-reported issue.)

Event Timeline

Amire80 renamed this task from Citations templates in "Jerusalem Calling" article couldn't be translated from Hebrew to Citations templates are sometimes translated to useless markup without content.Jul 4 2016, 5:10 AM

In this case the template תבנית:הערה
is not linked to any other language and exist only in Hebrew wikipedia. Is it possible to link that to other languages using wikidata?
Since there is no information that can help us to adapt to other languages, our fallback strategy - destruct template - is happening here

"Destroying" the template would be better than what is actually happening.

The template to which you linked simply adds a <ref> tag. It's pretty generic and simple; it is used very frequently in the Hebrew Wikipedia instead of the explicit <ref> tag because using "ref" creates RTL inconvenience while editing wiki syntax—see T30980. Now, if CX would just insert the whole <ref> tag and put all the content there, it would be useful—not as nice as a proper citation template, but at least it would have the content, such as URL, author, title, etc.

But what actually gets inserted is only markup, which is completely useless. All the content from the original citation template gets lost.

The template to which you linked simply adds a <ref> tag.

Template:

{{הערה|1=[[נתן דונביץ']], "הלו! הלו! ירושלים מדברת!", [[הגלגל]],30.3.1946}}

HTML:

<span about="#mwt1" class="mw-ref" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion  mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"הערה","href":"./תבנית:הערה"},"params":{"1":{"wt":"[[נתן דונביץ&#39;]], \"הלו! הלו! ירושלים מדברת!\", [[הגלגל]],30.3.1946"}},"i":0}}]}'>
   <a href="#cite_note-1" style="counter-reset: mw-Ref 1;">
      <span class="mw-reflink-text">[1]</span>
   </a>
</span>

The template to which you linked simply adds a <ref> tag.

Template:

{{הערה|1=[[נתן דונביץ']], "הלו! הלו! ירושלים מדברת!", [[הגלגל]],30.3.1946}}

HTML:

<span about="#mwt1" class="mw-ref" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion  mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"הערה","href":"./תבנית:הערה"},"params":{"1":{"wt":"[[נתן דונביץ&#39;]], \"הלו! הלו! ירושלים מדברת!\", [[הגלגל]],30.3.1946"}},"i":0}}]}'>
   <a href="#cite_note-1" style="counter-reset: mw-Ref 1;">
      <span class="mw-reflink-text">[1]</span>
   </a>
</span>

Yes—adding this would be OK, because this has the real citation content. The Hebrew text is a title of a newspaper article.

But what is actually added is span tags that I posted in the bug description, and it doesn't have any of this content.

Amire80 triaged this task as Medium priority.Jul 4 2016, 7:52 AM

Yes, The HTML I posted is the parsoids output of template. Once we adapt and fail, we just have span tags and a link inside it - it goes for HTML->wikitext adaptation and results the wikitext as you posted.

You mentioned about fallig back to <ref> while doing the 'destruct' step. We can think about that, there are pros and cons. We need a better solution that will avoid the destruct step as well.

Oh sorry—I was confused. Yes, what I initially posted is similar to the Parsoid output that you posted, without data-mw, which actually has the content.

Of course, the best thing is to post a properly adapted citation template, but that is hard. Translating it to <ref> with content would be better than posting useless <span>s. Not posting anything at all would also be better than useless <span>s.

@Amire80 Do you know whether this issue happens now?

Javanese Wikipedia is encountering this problem while translating from English through Content Translation. Cite templates are rendered empty or missing after a translation is published. Could you please help fixing this problem? Example: Elizabeth Olsen See: Rujukan (References).

Assigning to myself to test and monitor after the big template reworking is done.

This is probably not resolved by the CX template editor, even though this hasn't happened in the last few weeks. I'll continue monitoring it, as I do every day.

Arrbee moved this task from In Progress to Done on the Language-Q2-2016-17 Sprint 4 board.
Amire80 removed Amire80 as the assignee of this task.

Sorry, this, or something very similar is still happening, so I have to reopen and unassign myself, because as far as testing goes, it's done, and I found it's still happening :(

See https://he.wikipedia.org/w/index.php?oldid=19758654&action=edit and search for [[#cite_note-FOOTNOTEFowler2005213-2|<span class="mw-reflink-text"><nowiki>[2]</nowiki></span>]]. Curiously enough, the {{sfnb}} template, which seems to be the source for the problematic reference, is transferred to the translation, too.

You mean that the translation tools makes this happen? I saw a lot of these last week, never before, and thought some IP user makes copy paste from read view to VE.

You mean that the translation tools makes this happen? I saw a lot of these last week, never before, and thought some IP user makes copy paste from read vies to VE.

Yes, code like [[#cite_note-FOOTNOTEFowler2005213-2|<span class="mw-reflink-text"><nowiki>[2]</nowiki></span>]] always comes from Content Translation. I notice it when I search for <nowiki> tags, which I do almost every day (I've been a bit behind in the last few weeks because of illnesses and vacations, but I'm catching up). If somebody removes the <nowiki> tags before I do, I may miss it.

This bug doesn't happen very often, and it will probably go away by itself when we fully fix T152444, but it's useful to find its instances anyway, so if you have more examples, I really want to see them.

Arrbee renamed this task from Citations templates are sometimes translated to useless markup without content to [triage] Citations templates are sometimes translated to useless markup without content.Jun 25 2018, 2:57 PM
Arrbee assigned this task to Amire80.
Arrbee edited projects, added ContentTranslation; removed CX-out-of-beta.
Arrbee moved this task from Template Improvements to Check & Move on the ContentTranslation board.
Arrbee subscribed.

Assigned to Amir, to check on CX2

Arrbee renamed this task from [triage] Citations templates are sometimes translated to useless markup without content to Citations templates are sometimes translated to useless markup without content.Jul 6 2018, 3:00 PM
KartikMistry renamed this task from Citations templates are sometimes translated to useless markup without content to CX2: Citations templates are sometimes translated to useless markup without content.Jul 24 2018, 7:17 AM
KartikMistry renamed this task from CX2: Citations templates are sometimes translated to useless markup without content to CX2: Citations templates are sometimes translated to useless markup (or empty) without content.

CX2 status in screenshots:

image.png (225×1 px, 70 KB)

The template editor:

image.png (425×1 px, 34 KB)

After publishing

image.png (633×1 px, 199 KB)

@Amire80 Does this improve the situation?

Pginer-WMF claimed this task.
Pginer-WMF subscribed.

From recent conversations, it seems that the new version of Content Translation, even if it is not possible to find the equivalent template is not generating the useless markup mentioned in the description.