Wikisource:DoubleWiki Extension
This page is inactive and has been retained for historical interest. You can help by documenting its historical context and relevance. If you want to revive discussion regarding the subject, you are welcome to start a new discussion at the Scriptorium. |
About
editThe DoubleWiki extension displayed an article and its translation on two columns of the same page. It was written specifically for Wikisource.
Syntax
editThe extension was enabled on all subdomains. To see it, add '?match=xx' to the url of a page, where 'xx' is the language code of an existing interlanguage link.
In wikis that have configured it, you may click on the "⇔" symbols near interlanguage links. In order to enable these symbols in your subdomain, copy the following function to your wiki's Common.js file (you must be a sysop to do this) or your user's javascript skin overrides, if enabled:
/*
Bilingual links
Functions through the DoubleWiki extension.
Author: wikisource:fr:ThomasV, jQuery version by wikipedia:en:GreenReaper
*/
$(function(){
var doc_url = document.URL;
// iterate over all interlanguage links
$('.interlanguage-link>a[hreflang]').each(function() {
var lang = this.getAttribute("hreflang");
var qm = doc_url.indexOf( doc_url.indexOf('?title=') != -1 ? '&match=' : '?' );
var url = doc_url+"?match="+lang;
if( qm != -1 ) url = doc_url.substring(0,qm)+"?match="+lang;
this.outerHTML += "<a href='"+url+"'> ⇔</a>";
})
})
Examples
editVisit any of these pages, and click on the "⇔" symbols near interlanguage links: