Page MenuHomePhabricator

Source tab not showing up in the Translation namespace
Open, MediumPublic

Description

Author: morganation1

Description:
English Wikisource has recently acquired a new namespace called "Translation" (namespace number 114) as a result of bug #50007.

We intend to transclude pages from the Page namespace (ns:104) into this Translation namespace (ns:114) with the ProofreadPage extension, as is already done in the Main namespace (ns:0).

In the main namespace, this creates a tab at the top called "Source" between the standard "Page" and "Discussion" tabs. The source tab links to the source master page in the Index namespace (ns:106).

However, in the Translation namespace, the source tab does not appear.

Example in the Translation namespace: http://en.wikisource.org/wiki/Translation:Daany_Beedxe

And the same transclusion in the main namespace: http://en.wikisource.org/wiki/Daany_Be%C3%A9dxe

I suspect something just needs to be updated with the 114 namespace number.

For reference, the effect of this change in the Translation namespace can be seen on this page (which includes a non-default dynamic page layout): http://en.wikisource.org/wiki/Translation:Sleeping_Beauty


Version: unspecified
Severity: normal

Details

Reference
bz51980

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:10 AM
bzimport added a project: ProofreadPage.
bzimport set Reference to bz51980.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Jul 24 2013, 5:59 PM

CCing Reedy and Odder.

Tpt added a comment.Jul 28 2013, 3:47 PM

For the floating page-number links it's an issue in the PageNumbers.js script of en.wikisource.

For the source tab, it's because Proofread Page try to add it only in ns0. A solution is maybe to make Proofread Page add it to all content namespaces, excepts Page: and Index: ones. But there may be some unwanted side effects.

(In reply to Tpt from comment #2)

For the floating page-number links it's an issue in the PageNumbers.js
script of en.wikisource.

I'm pretty sure we've circumvented the floating page-number issue in the period since this bug was first identified by modifying the local en.WS PageNumbers.js file just like you recommended but it came at the expense of removing the feature from working in the Project ns sandbox. In short - they "work" in the Translation namespace but it's probably not the most elegant fix possible.

For the source tab, it's because Proofread Page try to add it only in ns0. A
solution is maybe to make Proofread Page add it to all content namespaces,
excepts Page: and Index: ones. But there may be some unwanted side effects.

Maybe the "refactoring" changed this state of affairs in the interim? It seems that that the ns-0 generation of the 'source' tab comes from 'ext.proofreadpage.article.js' in the line...

$( '#ca-nstab-main' ).after( '<li id="ca-proofread-source"><span>' + mw.config.get( 'proofreadpage_source_href' ) + '</span></li>' );

... the '#ca-nstab-main' being the key. Wouldn't ...

$( '#ca-nstab-translation' ).after( '<li id="ca-proofread-source"><span>' + mw.config.get( 'proofreadpage_source_href' ) + '</span></li>' );

... achieve the same tab generation but limited to just the translation namespace?

In T53980#587475, @Tpt wrote:

A solution is maybe to make Proofread Page add it to all content namespaces, excepts Page: and Index: ones. But there may be some unwanted side effects.

Would it make sense to add it anywhere a <pages /> element is used? e.g. have that insert some marker, and then have the JS insert the Source tab based on the presence of that marker?

@Samwilson Yes, everywhere the element is used it should generate the source tab, the page numbers along the left side, and any other elements that it generates in mainspace.

Are there other elements other than those two?

@Samwilson not sure. I know it generates a grey highlight under the text transcluded from a single page when you hover over the page number. There may be other functionalities that I am not aware of.

Xover added a subscriber: Xover.Oct 15 2019, 6:01 PM
Xover added a comment.Oct 15 2019, 7:12 PM

Ok, a couple of things here…

First, as @Tpt said in the 2013 comment, the page number links and grey background highlight on hover are provided by the Wikisource-local javascript MediaWiki:PageNumbers.js. It's entirely independent of ProofreadPage and needs to be handled separately (if only we had any Interface Admins…). All those bits of the task description can be ignored (I'll edit the task description shortly if I have sufficient permissions).

Second, the actual problem in ProofreadPage can't be fixed in ext.proofreadpage.article.js as @GOIII suggested in 2014. The javascript depends on ProofreadPage exposing a proofreadpage_source_href config variable to mw.util, which ProofreadPage doesn't do in the Translation: namespace.

So the fix has to happen in ProofreadPage proper (in PHP code). If the risk is merely that ProofreadPage exposes proofreadpage_source_href in various weird content namespaces, I think that's probably an acceptable risk. You won't even get a "Source" tab by default outside ns:0 because that's added by the javascript that triggers off a known namespace name (#ca-nstab-main vs. #ca-nstab-translation). We'll need to actively turn on display of it (by modifying that selector) for anything to happen. If concern about that is the stumbling block I say “Go for it!”.

Xover renamed this task from Source and page number links not showing up in the Translation namespace to Source tab not showing up in the Translation namespace.Oct 15 2019, 7:16 PM
Xover updated the task description. (Show Details)

If concern about that is the stumbling block I say “Go for it!”.

Agreed.