Last modified: 2013-02-08 21:42:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44160, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42160 - Recognize interwiki and language links
Recognize interwiki and language links
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
token-stream transforms (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Gabriel Wicke
: easy
Depends on: 44770
Blocks: 43332
  Show dependency treegraph
 
Reported: 2012-11-15 20:03 UTC by Gabriel Wicke
Modified: 2013-02-08 21:42 UTC (History)
3 users (show)

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


Attachments

Description Gabriel Wicke 2012-11-15 20:03:26 UTC
Currently Parsoid does not recognize interwiki / language links and just treats them as regular wiki links.

The most important part of this for the December release is the recognition of language links, which are normally rendered as 'Languages' in the sidebar.

To this end, the prefix of a wiki link processed in the LinkHandler (js/lib/ext.core.LinkHandler.js) needs to be matched against a regexp of interwiki prefixes. We already have such a regexp available in the environment as env.interwikiRegexp, which should be reachable as this.manager.env.interwikiRegexp inside the link handler.

For recognized interwiki links ([[de:Foo]] for example), no link should be rendered and something like <link rel="mw:WikiLink/Language" href="de:Foo"> should be produced instead. This also needs to be round-tripped, which will require a small tweak in the serializer. Please ask in #mediawiki-parsoid when you get to this stage.
Comment 1 Mark Holmquist 2012-12-07 21:46:17 UTC
https://gerrit.wikimedia.org/r/37517
Comment 2 Gabriel Wicke 2012-12-11 01:48:24 UTC
Now merged, so language links are supported. Interwiki links left to do.
Comment 3 Gabriel Wicke 2013-01-22 20:01:52 UTC
We still need to separate interwiki from language links. Language links are like interwiki prefixes ([[en:Foo]] for example), but are listed in the 'this article in other languages' section on the left. Plain interwiki links on the other hand always render inline, but link to an external resource with the base HTTP URL corresponding to the interwiki prefix.
Comment 4 Gabriel Wicke 2013-01-22 20:11:44 UTC
Interwiki prefixes and languages are returned separately from the API: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&meta=siteinfo&format=json&siprop=interwikimap|languages

So, steps to implement this would be:

* Add support for interwiki prefixes and languages in WikiConfig (lib/mediawiki.WikiConfig.js).

* Use it in the link handler to detect interwiki / language links and render them differently, using the RDFa in http://www.mediawiki.org/wiki/Parsoid/RDFa_vocabulary#Language_links and http://www.mediawiki.org/wiki/Parsoid/RDFa_vocabulary#Interwiki_non-language_links.

* Add support for these types in the WikitextSerializer and make sure that these links round-trip properly.
Comment 5 Gabriel Wicke 2013-01-28 22:30:13 UTC
Work in progress by Jan Christiansen on language and interwiki links in https://gerrit.wikimedia.org/r/#/c/46027/ and https://gerrit.wikimedia.org/r/#/c/46028/.
Comment 6 Gabriel Wicke 2013-02-08 21:42:16 UTC
https://gerrit.wikimedia.org/r/#/c/46027/ is merged, fixing this bug. Basic editing support is there too, but needs testing and possibly tweaks.

Thanks Jan for implementing this!!

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


Navigation
Links