Page MenuHomePhabricator

TimedText namespace is using CamelCase for no good reason
Open, LowPublic

Description

As Rich Farmbrough stated 'Welcome back CamelCase'. Let's just call it 'Timed text' or 'Timed Text' (that's what the spec calls it).


Version: master
Severity: normal

Details

Reference
bz41692

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:06 AM
bzimport set Reference to bz41692.

mdale wrote:

You can have spaces in namespaces? I don't think this will be something that is easy to change.

Is it easy to add canonical mapping for namespaces ?

I see. Feel free to remove the easy keyword in such cases, you definitely know better than I do. :)

(In reply to comment #1)

You can have spaces in namespaces?

You mean like "Article talk"?

Re-adding +easy since this is (literally) a 2 line-change.

mdale wrote:

The reason I think it would not be so easy, is that we already have the TimedText namespace on commons with associated links, pages etc. I have not looked at this closely but I don't think it would be trivial.

There are places in the code where we have to discover the timed text namespace on the remote host and have to look it up by name i.e: handlers/TextHandler/TextHander.php line 98:

foreach( $data['query']['namespaces'] as $ns ){
if( $ns['*'] == 'TimedText' ){

		$this->remoteNs = $ns['id'];

}
}

That being said it should be possible to update ( with some work ) if the caps on Text is a bad eye sore.

(In reply to comment #5)

The reason I think it would not be so easy, is that we already have the
TimedText namespace on commons with associated links, pages etc. I have not
looked at this closely but I don't think it would be trivial.

This is not hard. It's why we have the namespaceDupes.php maintenance script.

There are places in the code where we have to discover the timed text namespace
on the remote host and have to look it up by name i.e:
handlers/TextHandler/TextHander.php line 98:

foreach( $data['query']['namespaces'] as $ns ){

if( $ns['*'] == 'TimedText' ){
    $this->remoteNs = $ns['id'];
}

}

Any code that looks like that should be updated immediately. To compare namespaces you should *always* do it based on the ID, *never* the name.

mdale wrote:

How do you know that timed text is timed text on a foreign wiki if not by name ?

The issue is it has to query the remote wiki api by namespace number, and there was no global extension namespace manifest early on resulting in commons using 102 for timed text, where as timed media handler got 710:
http://www.mediawiki.org/wiki/Extension_default_namespaces#TimedMediaHandler

To solve the problem I imagine we should move all the commons timed text over to the manifest id of "710" .. or just hard code per-wiki namespace id overrides in the foreign repo settings ?