Ticket #28730: 28730.diff
File 28730.diff, 1.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/ms.php
557 557 // See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too. 558 558 559 559 function mu_dropdown_languages( $lang_files = array(), $current = '' ) { 560 $ flag= false;560 $en_us = $en_gb = false; 561 561 $output = array(); 562 562 563 563 foreach ( (array) $lang_files as $val ) { 564 564 $code_lang = basename( $val, '.mo' ); 565 565 566 566 if ( $code_lang == 'en_US' ) { // American English 567 $ flag= true;567 $en_us = true; 568 568 $ae = __( 'American English' ); 569 569 $output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>'; 570 570 } elseif ( $code_lang == 'en_GB' ) { // British English 571 $ flag= true;571 $en_gb = true; 572 572 $be = __( 'British English' ); 573 573 $output[$be] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>'; 574 574 } else { … … 578 578 579 579 } 580 580 581 if ( $flag === false ) // WordPress english 581 if ( ! $en_us && ! $en_gb ) { 582 // No English languages installed, display the default language as English 582 583 $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . "</option>"; 584 } else if ( ! $en_us && $en_gb ) { 585 // British English is installed, display the default language as American English 586 $output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'American English' ) . "</option>"; 587 } 583 588 584 589 // Order by name 585 590 uksort( $output, 'strnatcasecmp' );