Page MenuHomePhabricator

Basic support for editing references in Section Translation
Open, MediumPublic

Description

References are important in Wikipedia and they may appear in many different circumstances (defined in a different section or inside a template, being available in the target language or not, etc.). This ticket focuses on supporting the basic case where a reference is defined in the section the user is translating, which currently does not seem well supported in Section Translation.

When translating the "Formation" section of the Moon article from English to Spanish in the test instance, I'm not able to access the content of any reference to edit them. For example, editing the second sentence of the section allows to select the first reference with the editor but a card (incorrectly) indicates it cannot be edited because it is defined inside another template (a known limitation of VE: T52896):

sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE).png (1×640 px, 132 KB)

("Start from scratch approach" is illustrated but the issue also happens when using an MT system such as Apertium as shown in the video at the bottom of the ticket)

Looking at the original article that is not the case. Editing the source of the section you can notice the reference contents are there:

Screenshot 2021-02-16 at 09.53.11 2.png (160×839 px, 65 KB)

Switching to Visual Editor, the reference seems supported there:

DesktopMobileMobile (editing the template)
Screenshot 2021-02-16 at 09.56.13 2.png (347×606 px, 94 KB)
en.m.wikipedia.org_wiki_Moon_veswitched=1(iPhone 6_7_8).png (1×750 px, 210 KB)
en.m.wikipedia.org_wiki_Moon_veswitched=1(iPhone 6_7_8) (1).png (1×750 px, 125 KB)

The expected result would be for the reference to be displayed and edited in Visual Editor also when used inside Section Translation.


The video below shows how none of the references in the example sentence shows the details also when using Apertium:

Event Timeline

Pginer-WMF triaged this task as Medium priority.Feb 16 2021, 9:03 AM
Pginer-WMF created this task.
Pginer-WMF renamed this task from Support editing references in Section Translaiton to Basic support for editing references in Section Translation.Feb 16 2021, 9:41 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF moved this task from Backlog to Mobile editor on the SectionTranslation board.

I did a quick investigation. The screenshots in orginal ticket is slightly confusing because the reference clicked is near "centrifugal force" and SX shows a reference popup saying "This reference is defined in a template or generated block and for now can be only edited in source mode". But all other screenshots are based on the reference near the previous reference near "Several forming mechanisms have been proposed".

The behaviour of reference near "centrifugal force" is same as what you get from mobile VE editor.

image.png (742×363 px, 88 KB)

This reference is a named reference <ref name="Binder" /> and the actual definition is at the last section of the article.

<ref name="Binder">{{cite journal |last=Binder |first=A.B. |title=On the origin of the Moon by rotational fission |journal=[[The Moon]] |date=1974 |volume=11 |issue=2 |pages=53–76 |bibcode=1974Moon...11...53B |doi=10.1007/BF01877794|s2cid=122622374 }}</ref>

So it is a case of T52896: VisualEditor: Support editing citations defined within a template and a case of reference content not local to current section being edited.

But even then the reference near "...proposed" has the following content:

<ref>{{cite journal |doi=10.1126/sciadv.1602365 |pmid=28097222 |pmc=5226643 |journal=Science Advances |date=2017 |volume=3 |issue=1 |title=Early formation of the Moon 4.51 billion years ago |last=Barboni |first=M. |author2=Boehnke, P. |author3=Keller, C.B. |author4=Kohl, I.E. |author5=Schoene, B. |author6=Young, E.D. |author7=McKeegan, K.D. |page=e1602365 |bibcode=2017SciA....3E2365B}}</ref>

This is reference inside cite journal template. But mobile VE is able to provide editing support for that. SX cannot. Why? Need to check that.

Sorry for the confusion. You are right, the initial screenshot is highlighting the wrong reference. Now I see that Apertium moved some references to the end (T228940) so the intended reference is no longer the first one.
I captured a screenshot (based on start from scratch approach to make sure the reference is the same) to clarify this and a vide where it is clear how none of the references in such sentence show their contents:

sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE).png (1×640 px, 132 KB)

I'll add these to the description to avoid future confusions. Thanks for flagging this.

Change 685713 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] SX: Fix reference support in VisualEditor integration

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

Change 685713 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Fix reference support in VisualEditor integration

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

Checking the current status of this ticket, it seems that references can be edited now but there are a couple of aspects missing:

  • The reference card shows empty initially. It was expected to render the reference text.
  • Editing requires to go through multiple steps: edit the reference which contains a template (e.g. cite web) and then edit the template. When using Mobile Visual Editor directly, the specific form to edit the template is shown.
sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE).png (1×640 px, 90 KB)
sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE) (1).png (1×640 px, 121 KB)
sx.wmflabs.org_index.php_Special_ContentTranslation_page=Moon&from=en&to=es&sx=true(iPhone 5_SE) (2).png (1×640 px, 71 KB)

@santhosh is the above what is pending, keeping the ticket in the in-progress column or do we need separate tickets for the above?

@Pginer-WMF we will require separate tickets for them. We might be missing some VisualEditor specific settings somewhere and we can ask VE team how to achieve this UI improvements. I did not knew that VE can directly open template editor from reference. I just tried and found that behavior in mobile VE

@Pginer-WMF we will require separate tickets for them.

Thanks for the update. I'll create separate ticket

We might be missing some VisualEditor specific settings somewhere and we can ask VE team how to achieve this UI improvements. I did not knew that VE can directly open template editor from reference. I just tried and found that behavior in mobile VE

For context, on desktop this was supported at T199512, but a regression makes it show both options on the desktop editor right now (T232330). Based on comments (T199512#4570362) this seemed related to the integration of Citoid, but I don't know the technical details (or how much of all this applies to Mobile VE).