MediaWiki:Gadget-WiktSidebarTranslation.js

$(function{	$("#p-lang .interlanguage-link a").each(function{ var langnameMatch = $(this).attr("title").match(/(.*) – (.*)/); var langname = $(this).attr("title"); //some wiktionaries like afrikaans have '' as their main page if (langnameMatch && langnameMatch.length >= 3) langname = langnameMatch[2];

$(this).text(langname) .attr("lang", "en");//this line breaks compact languages });	$("#p-lang .interlanguage-link").sort(function(lia, lib){ return $(lia).children.first.text < $(lib).children.first.text ? -1 : 1;	}).appendTo("#p-lang>div>ul"); });