Ensure the language selection dropdown is output correctly. Fixes #14255 for trunk props SergeyBiryukov.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
279c35a58f
commit
5fdb333ab3
|
@ -653,20 +653,20 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
|
||||||
if ( $code_lang == 'en_US' ) { // American English
|
if ( $code_lang == 'en_US' ) { // American English
|
||||||
$flag = true;
|
$flag = true;
|
||||||
$ae = __( 'American English' );
|
$ae = __( 'American English' );
|
||||||
$output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . $ae . '</option>';
|
$output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';
|
||||||
} elseif ( $code_lang == 'en_GB' ) { // British English
|
} elseif ( $code_lang == 'en_GB' ) { // British English
|
||||||
$flag = true;
|
$flag = true;
|
||||||
$be = __( 'British English' );
|
$be = __( 'British English' );
|
||||||
$output[$be] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . $be . '</option>';
|
$output[$be] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';
|
||||||
} else {
|
} else {
|
||||||
$translated = format_code_lang( $code_lang );
|
$translated = format_code_lang( $code_lang );
|
||||||
$output[$translated] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . esc_html ( $translated ) . '</option>';
|
$output[$translated] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html ( $translated ) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $flag === false ) // WordPress english
|
if ( $flag === false ) // WordPress english
|
||||||
$output[] = '<option value=""' . selected( $current, '' ) . '>' . __( 'English' ) . "</option>";
|
$output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . "</option>";
|
||||||
|
|
||||||
// Order by name
|
// Order by name
|
||||||
uksort( $output, 'strnatcasecmp' );
|
uksort( $output, 'strnatcasecmp' );
|
||||||
|
|
Loading…
Reference in New Issue