Page MenuHomePhabricator

Show section placeholder before "References" and similar sections
Closed, ResolvedPublic

Description

Currently Section translation publishes content at the very end of the article. This is relevant for both the publish step (T252542) and the "Compare the contents before translating" step (T241589), where a placeholder is shown.

Making the initial placement to be more likely to be correct is important since rearranging the section order in the final article is not an easy task on mobile (unlike desktop there is no option to edit the whole contents of the article).

This ticket proposes to make the placement of the translated section smarter. There are two strategies that we can apply (and maybe combine):

  • Identify "closing sections" that normally go at the end (such as "External links", "References" or "See also") after the rest of "content sections". In this way, when the user translates a "content section" it would be added after other "content sections" but before these "closing sections".
  • Showing a section it in a consistent position with equivalent sections from the source article. The source article may follow already a logical sequence that we may want to keep.

As an example, note how this edit is placed after references and templates that are expected to be at the very end of the article:

bn.wikipedia.org_w_index.php_title=%E0%A6%86%E0%A6%A6%E0%A7%8D%E0%A6%A6%E0%A6%BF%E0%A6%B8_%E0%A6%86%E0%A6%AC%E0%A6%BE%E0%A6%AC%E0%A6%BE&curid=94341&diff=4910200&oldid=4907958(iPad Pro).png (2×2 px, 871 KB)


Independently of this, we may consider providing better control on where to place the translated section on mobile (T279910). However, improving the initial placement would make such feature to be needed less often.

Event Timeline

We got feedback asking for this:

When a section is being published it is getting added to the very end of the article, like this. The section should not be added at the very end at all times, else it would require additional editing time to correct this. Section translation should instead deal with this more intelligently. For instance:

  • If the added section is an ‘external link’ then its ok to be added at the end
  • If the added section is a ’see also’ then it should be added before ‘external links’ and ‘reference’ section, assuming those two sections exist for that article
  • If the added section is something else, then it should be added before ‘external links’, ‘reference’ and ‘see also’ section, assuming those two sections exist for that article.
Pginer-WMF raised the priority of this task from Medium to High.Feb 25 2021, 10:07 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF updated the task description. (Show Details)

Change 667620 had a related patch set uploaded (by Nik Gkountas; owner: Nik Gkountas):
[mediawiki/extensions/ContentTranslation@master] SX Publishing: Position new section before "References"

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

Change 670820 had a related patch set uploaded (by Nik Gkountas; owner: Nik Gkountas):
[mediawiki/services/cxserver@master] Add suggest target section titles by source section titles action

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

Change 672998 had a related patch set uploaded (by Nik Gkountas; owner: Nik Gkountas):
[mediawiki/extensions/ContentTranslation@master] SX publishing: Position new section before "References"

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

Change 667620 abandoned by Nik Gkountas:
[mediawiki/extensions/ContentTranslation@master] SX Publishing: Position new section before "References"

Reason:
Abandon in favor of 672998

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

Change 670820 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Add suggest target section titles by source section titles action

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

Change 672999 had a related patch set uploaded (by Nik Gkountas; owner: Nik Gkountas):
[mediawiki/extensions/ContentTranslation@master] SX Compare contents: Fix new section placeholder position

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

Change 672999 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] SX Compare contents: Fix new section placeholder position

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

Change 677557 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2021-04-07-062518-production

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

Change 672998 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX publishing: Position new section before "References"

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

Change 677557 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2021-04-07-062518-production

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

The mapping process cannot be 100% accurate, but finding specific examples where it fails can help to debug and improve the way it works. So:

  • I don't consider this a blocker for the current task to be completed (unless the issue were happening very frequently)
  • I think it is worth creating a separate task to investigate this example and polish the algorithm further.