Page MenuHomePhabricator

Labeled section transclusion incompatible with translate extension
Closed, ResolvedPublic

Description

Two problems emerged recently with transcluding sections from a page marked up for translation.
The markup was something like:

==Sectionname==  <!--T:nn-->
<translate> ... text ... </translate>

Problems:
*The #section-h function did not recognise the section at all, probably confused by the comment on the heading line.
*The #section function picked up the text between the <section begin> and <section end> tags, but did not process or drop the <translate> and </translate> tags.
See https://commons.wikimedia.org/w/index.php?oldid=334514388 for an example.

The problems are blocking translation of about 200 Help pages on Wikimedia Commons.

Event Timeline

Aymatth2 created this task.Jan 24 2019, 4:55 PM
Restricted Application added subscribers: jeblad, Aklapper. · View Herald TranscriptJan 24 2019, 4:55 PM
Aymatth2 updated the task description. (Show Details)Jan 24 2019, 4:57 PM
4nn1l2 added a subscriber: 4nn1l2.Jan 25 2019, 6:46 AM
Nikerabbit triaged this task as Lowest priority.Jan 25 2019, 12:09 PM
Nikerabbit moved this task from Backlog to cross projects on the MediaWiki-extensions-Translate board.
Aymatth2 updated the task description. (Show Details)Jan 26 2019, 12:59 PM
Aymatth2 raised the priority of this task from Lowest to Needs Triage.Jan 26 2019, 1:01 PM
Aymatth2 updated the task description. (Show Details)Jan 26 2019, 1:10 PM
Aklapper triaged this task as Lowest priority.Jan 26 2019, 1:15 PM

@Aymatth2: Do you plan to work on this, or why did you change the priority of this task?

@Aymatth2: Do you plan to work on this, or why did you change the priority of this task?

@Aklapper: The initial description did not show the impact, which is to block translation of 200 help pages in Commons which hold information on whether files can be uploaded and are widely referenced in deletion discussions. I assume triage takes into account impact and difficulty of fixing, so put it back for review.

Aklapper raised the priority of this task from Lowest to Needs Triage.Jan 30 2019, 12:34 AM

Ah, thanks for the explanation!

Today I was struggling with a page on Commons, as there were some changes made to the original, so I had to restore the translation tags (wasn't aware of the problem), and mark the page for translation for the changes to apply to the translated pages. Then I saw that the sections of the page are being transcluded faultly. At first it said that "no information is available" under the relevant section. Then I removed the section header comment, and noticed that it's displaying the <translate> tags and refuses to display the rest of the transcluded sections (the ones that go below) on that page. So I removed the page from translation system. Indeed, it's impossible to work with those pages right now.

jeblad removed a subscriber: jeblad.Feb 2 2019, 5:20 AM
4nn1l2 awarded a token.Feb 2 2019, 8:10 PM
Dalba awarded a token.Feb 24 2019, 4:50 AM
Dalba added a subscriber: Dalba.
Aymatth2 closed this task as Resolved.EditedFeb 26 2019, 4:22 PM
Aymatth2 claimed this task.

Thanks to users @4nn1l2 and @Dalba a fix has been found: instead of having #section-h extract sections from pagename, it should extract them from pagename/en. This apparently returns the translated version of the page to #section-h, in this case translated from English to English with the <translate> tags and <!--T:nn--> comments removed. Possibly the #section-h documentation should be upgraded to point out this solution.