Make WordPress Core

Ticket #28858: 28858.patch

File 28858.patch, 1.7 KB (added by joedolson, 10 years ago)

Improves a11y of language selector

  • wp-admin/includes/upgrade.php

     
    21602160endif;
    21612161
    21622162function wp_install_language_form( $languages ) {
    2163         echo "<fieldset>\n";
     2163        echo "<fieldset tabindex='-1'>\n";
    21642164        echo "<legend class='screen-reader-text'>Select a default language</legend>\n";
    21652165        echo '<input type="radio" checked="checked" class="screen-reader-input language-chooser-input" name="language" id="language_default" value="">';
    21662166        echo '<label for="language_default">English (United States)</label>';
     
    21702170                if ( isset( $languages[ WPLANG ] ) ) {
    21712171                        $language = $languages[ WPLANG ];
    21722172                        echo '<input type="radio" name="language" checked="checked" class="' . esc_attr( $language['language'] ) . ' screen-reader-input" id="language_wplang" value="' . esc_attr( $language['language'] ) . '">';
    2173                         echo '<label for="language_wplang">' . esc_html( $language['native_name'] ) . "</label>\n";
     2173                        echo '<label for="language_wplang" lang="'. esc_attr( $language['language'] ) . '">' . esc_html( $language['native_name'] ) . "</label>\n";
    21742174                }
    21752175        }
    21762176
     
    21792179                echo '<label for="language_' . esc_attr( $language['language'] ) . '">' . esc_html( $language['native_name'] ) . "</label>\n";
    21802180        }
    21812181        echo "</fieldset>\n";
    2182         echo '<p class="step"><span class="spinner"></span><input type="submit" class="button button-primary button-hero" value="&raquo;" /></p>';
     2182        echo '<p class="step"><span class="spinner"></span><input type="submit" class="button button-primary button-hero" value="Set &raquo;" /></p>';
    21832183}
    21842184
    21852185/**