User:Erutuon/scripts/languages.js

//

function getLangCodeByName(langName) {	var langCode = ""; $.ajax({		url: mw.util.wikiScript( 'api' ),		data: {			action: 'expandtemplates',			format: 'json',			prop: 'wikitext',			text: ''		},		type: 'GET',		success: function( result ) {			langCode = result.expandtemplates.wikitext;		},		error: function( xhr ) {			console.log( 'Error.\nRequest failed.' );		},       async: false	}); return langCode; }

//