Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Created August 27, 2013 16:38
Show Gist options
  • Save jdlrobson/6355928 to your computer and use it in GitHub Desktop.
Save jdlrobson/6355928 to your computer and use it in GitHub Desktop.
Turns the language section generated by Translate extension into a language button at the bottom of the page on the mobile site
$( function() {
var $container = $( '<div id="mw-mf-language-section"><h2 /><ul id="mw-mf-language-selection" /></div>' ).appendTo( '#content' );
$container.find( 'h2' ).text( mw.msg( 'mobile-frontend-language-article-heading' ) );
$( '.mw-pt-languages-list a' ).each( function() {
$( '<li>' ).append( this ).appendTo( '#mw-mf-language-selection' );
} );
// cleanup
$( '.mw-pt-languages' ).remove();
// create the button
mw.mobileFrontend.emit( 'languages-loaded' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment