Created
August 27, 2013 16:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( 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