diff --git a/src/js/_enqueues/lib/language-chooser.js b/src/js/_enqueues/lib/language-chooser.js index 628b8a81fb..9ca3ea679a 100644 --- a/src/js/_enqueues/lib/language-chooser.js +++ b/src/js/_enqueues/lib/language-chooser.js @@ -1,5 +1,8 @@ jQuery( function($) { - +/* + * Set the correct translation to the continue button and show a spinner + * when downloading a language. + */ var select = $( '#language' ), submit = $( '#language-continue' ); @@ -8,6 +11,10 @@ if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) { } select.focus().on( 'change', function() { + /* + * When a language is selected, set matching translation to continue button + * and attach the language attribute. + */ var option = select.children( 'option:selected' ); submit.attr({ value: option.data( 'continue' ), @@ -16,8 +23,7 @@ select.focus().on( 'change', function() { }); $( 'form' ).submit( function() { - // Don't show a spinner for English and installed languages, - // as there is nothing to download. + // Show spinner for languages that need to be downloaded. if ( ! select.children( 'option:selected' ).data( 'installed' ) ) { $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' ); }