User:Violine1101/translation-projects.js

var langs = { 'id': 'Bahasa Indonesia', 'no': 'Norsk' };

if ( $( '.translation-project-link' ).length ) { var lastPortalSection = $( "#p-lang" ); if ( !$( '#p-lang' ).length ) lastPortalSection = $( '#p-tb' ); lastPortalSection.after(       $( ' ', { 'class': 'portal expanded', 'id': 'p-translations', 'aria-labelledby': 'p-translations-label' } ).append( $( ' ', {               'id': 'p-translations-label',                'href': '#',                'aria-haspopup': 'true',                'aria-controls': 'p-translations-list',                'role': 'button',                'aria-pressed': 'true',                'aria-expanded': 'true'            } ).html( 'Translation projects' ), $( ' ', { 'class': 'body' } ).append(               $( '', { 'id': 'p-translation-list' } )            ).show )   );    $( '.translation-project-link' ).each( function {        var data = $( this ).text;        var json = JSON.parse( data );        if ( !json || json.lang === undefined || json.link === undefined || langs[json.lang] === undefined ) {        	$( this ).text( 'Error when generating translation project link "' + json.lang + '"' ).show;        	return;        }        var lang = json.lang,            pagename = json.link;        $( '#p-translation-list' ).append( $( '', { 'class': 'interlanguage-link interwiki-' + lang } ).append(               $( '', {                   'title': pagename + ' – ' + langs[lang], 'href': 'https://minecraft.gamepedia.com/' + pagename + '/' + lang, 'lang': lang, 'hreflang': lang } )               .html( langs[lang] )            ) );   } ); }