User:Mike Dillon/Scripts/langnames.js

var wgLangNames = {};

function addLanguageName(code, name) { wgLangNames[code] = name; }

function getLanguageName(code) { return wgLangNames[code]; }

function getLanguageCodes { var codes = []; for (code in wgLangNames) { codes.push(code); }   return codes; }

addLanguageName('en', 'English'); addLanguageName('et', 'Estonian'); addLanguageName('ru', 'Russian'); addLanguageName('sv', 'Swedish');