--- a/wp/wp-admin/js/language-chooser.js Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-admin/js/language-chooser.js Mon Oct 14 18:28:13 2019 +0200
@@ -1,5 +1,12 @@
+/**
+ * @output wp-admin/js/language-chooser.js
+ */
+
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 +15,10 @@
}
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 +27,7 @@
});
$( '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' );
}