Last modified: 2013-02-17 05:55:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 39199 - Recursive interwiki link handling should be possible
Recursive interwiki link handling should be possible
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
  Show dependency treegraph
Reported: 2012-08-09 17:18 UTC by Daniel Friesen
Modified: 2013-02-17 05:55 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Daniel Friesen 2012-08-09 17:18:07 UTC
Sometimes interwiki links like [[Wikipedia:fr:France]] are used.

This could be problematic when we start outputting hreflang on interwiki links.
[[Wikipedia:fr:France]] would end up with a hreflang="en" instead of the correct hreflang="fr".

Additionally it would be much nicer to have direct hrefs. Besides looking saner when the user hovers over the link it would also play much nicer with the browser's :visited handling.

And it's not that unreasonable for someone to suggest "We should have a sitename in the title/tooltip". In which case [[Wikipedia:fr:France]] becomes "fr:France - Wikipedia" instead of the "France - Wikipédia" that we want.


Basically this means that after we've parsed out our interwiki we should consider parsing out interwikis that other wikis use.

I manage to come up with an idea how this could be done for non-local wikis.

We handle this in multiple passes.
- The first time we see [[Wikipedia:fr:France]] when parsing an article we end up outputting it the same way we do now as (Wikipedia, fr:France)
- Because an interwiki for a site we don't know any information about was used a job is queued after parsing
- In the job we do an API fetch to the other wiki to get site info and the wiki's local interwiki map and we store this info
- After this info is fetched we do refreshlinks jobs on the page(s) where interwiki links to this wiki was used
- This second time around when parsing now that we've stored the interwiki map we parse [[Wikipedia:fr:France]] as (Wikipedia:fr, France) now that we know that Wikipedia: has a fr: inside of it's local interwiki map.

This is the way it would work for remote wikis. We might do the code for this a little more abstractly. So that local cases that only require a sql lookup can be handled. And so that cases like Wikia's custom [[w:c:foo:Bar]] can also be handled by them implementing some extra code.

Note You need to log in before you can comment on or make changes to this bug.