Page MenuHomePhabricator

View page links need adjustment when translating sections on desktop
Closed, ResolvedPublic

Description

When translating on desktop the "Legal status" section of the Moon article with this link (notice the "sourcesection=Legal+status" parameter) the "View page" links that are provided just below the title are observed not to work properly:

  • For the source content, the "view page" link is linking to the wrong place. Currently it link to the Legal status article. That is, an article that happens to have the same title as the current section. The expected behaviour would be for it to link to the section of the source article (Moon). That is, a link like this: https://en.wikipedia.org/wiki/Moon#Legal_status
  • For the target content, the "view page" link is not showing as if the page did not exist on the target wiki. When expanding an existing article, the target page exists (Lluna in this case), and the "view page" link should be visible and linking to it.

Event Timeline

Pginer-WMF triaged this task as Medium priority.Sep 2 2022, 11:53 AM
Pginer-WMF created this task.

Change 832473 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX section translation: Fix view page link to always use page title

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

Change 832473 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX section translation: Fix view page link to always use page title

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

Change 855032 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX View page link: Include hash for section title inside target URL

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

Change 855032 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX View page link: Include hash for section title inside target URL

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

The page link doesn't work properly when the section title consists of two words (e.g. "Legal status"). Moving this back to Quarter Backlog until this issue is fixed.

Change 865690 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX View page link: Escape hash for section title in target URL

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

Change 865690 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX View page link: Escape hash for section title in target URL

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

Based on the QA video, the fixes focus on the first bullet point from the description, but the second one seems still missing:

  • For the target content, the "view page" link is not showing as if the page did not exist on the target wiki. When expanding an existing article, the target page exists (Lluna in this case), and the "view page" link should be visible and linking to it.

Moving back to in progress.

@Pginer-WMF Yes you are right.. thanks for that clarification

As it's apparent in the screenshot below, the hash for the section title is being added, even when not needed, i.e. when undefined.

Screenshot 2023-01-30 at 7.16.03 PM.png (960×1 px, 419 KB)

Change 884968 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] Fix "view page" link hash to not be added when undefined

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

Change 884969 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX: Add "view page" link to target column for section translations

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

Change 884968 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Fix "view page" link hash to not be added when undefined

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

Change 884969 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Add "view page" link to target column for section translations

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

Test status: QA PASS

For the second part the view page link is visible and linking to the expected page