WordPress.org

Make WordPress Core

Ticket #43950: language-chooser.diff

File language-chooser.diff, 1.2 KB (added by manuelaugustin, 3 years ago)
  • src/wp-admin/js/language-chooser.js

    diff --git src/wp-admin/js/language-chooser.js src/wp-admin/js/language-chooser.js
    index 628b8a8..63f2ce6 100644
     
    11jQuery( function($) {
    2 
     2/*
     3 * Set the correct translation to the continue button and show a spinner
     4 * when downloading a language.
     5 */
    36var select = $( '#language' ),
    47        submit = $( '#language-continue' );
    58
    if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) { 
    811}
    912
    1013select.focus().on( 'change', function() {
     14        /*
     15         * When a language is selected, set matching translation to continue button
     16         * and attach the language attribute.
     17         */
    1118        var option = select.children( 'option:selected' );
    1219        submit.attr({
    1320                value: option.data( 'continue' ),
    select.focus().on( 'change', function() { 
    1623});
    1724
    1825$( 'form' ).submit( function() {
    19         // Don't show a spinner for English and installed languages,
    20         // as there is nothing to download.
     26        // Only show spinner for not-installed languages as there is nothing to download.
    2127        if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
    2228                $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );
    2329        }