User:AT/Langbox

What?
A tiny tool that adds support for languages other than English.

Why?
As official wikis in other languages seem unlikely, the next best thing is translating this wiki. It's easy enough to do via google, but this just speeds up the process.

How?
Add the following to your monobook.js: function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); } importScript('User:AT/langbox.js');

Extra languages
By default, the tool allows translation into the following languages:
 * French
 * German
 * Spanish
 * Italian
 * Dutch
 * Chinese (Simplified and Traditional)

However, it offers support for many more. You can specify additional languages using the following syntax:

var userLanguages = function { addLangSite('Language', 'code'); }

Where 'code' is a language code used by the Google translator. The list of supported languages and corresponding codes are shown below.

So, for example, if you wanted options to translate into Finnish, Swedish and Norwegian, you'd add the following to your monobook.js: function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); } importScript('User:AT/langbox.js');

var userLanguages = function { addLangSite('Finnish', 'fi'); addLangSite('Swedish', 'sv'); addLangSite('Finnish', 'no'); }

Note: If you already have the importScript function somewhere on the page, no need to add it again.