Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/wp-admin/css/install.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ body.language-chooser {
max-width: 300px;
}

.language-chooser [for="language"] {
display: inline-block;
margin-bottom: 16px;
font-size: 14px;
font-weight: 600;
}

.language-chooser select {
padding: 8px;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/translation-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function wp_install_language_form( $languages ) {

$installed_languages = get_available_languages();

echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n";
echo "<label for='language'>Select a default language</label>\n";
Comment thread
joedolson marked this conversation as resolved.
echo "<select size='14' name='language' id='language'>\n";
echo '<option value="" lang="en" selected="selected" data-continue="Continue" data-installed="1">English (United States)</option>';
echo "\n";
Expand Down
7 changes: 3 additions & 4 deletions src/wp-admin/setup-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,15 @@ function setup_config_display_header( $body_classes = array() ) {
$body_classes = (array) $body_classes;
$body_classes[] = 'wp-core-ui';
$body_classes[] = 'admin-color-modern';
$dir_attr = '';

if ( is_rtl() ) {
$body_classes[] = 'rtl';
$dir_attr = ' dir="rtl"';
}

header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html<?php echo $dir_attr; ?>>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Expand Down Expand Up @@ -134,7 +133,7 @@ function setup_config_display_header( $body_classes = array() ) {
$languages = wp_get_available_translations();
if ( $languages ) {
setup_config_display_header( 'language-chooser' );
echo '<h1 class="screen-reader-text">Select a default language</h1>';
echo '<h1 class="screen-reader-text">Welcome to WordPress</h1>';
echo '<form id="setup" method="post" action="?step=0">';
wp_install_language_form( $languages );
echo '</form>';
Expand Down
9 changes: 6 additions & 3 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -4543,13 +4543,16 @@ function get_language_attributes( $doctype = 'html' ) {
$attributes[] = 'dir="rtl"';
}

$lang = get_bloginfo( 'language' );
$lang = get_bloginfo( 'language' );
$html_type = get_option( 'html_type' );

if ( $lang ) {
if ( 'text/html' === get_option( 'html_type' ) || 'html' === $doctype ) {
if ( 'text/html' === $html_type || 'html' === $doctype ) {
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
}

if ( 'text/html' !== get_option( 'html_type' ) || 'xhtml' === $doctype ) {
// The $html_type option may be false on a new install on the setup-config.php page.
if ( ( $html_type && 'text/html' !== $html_type ) || 'xhtml' === $doctype ) {
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
}
}
Expand Down
Loading