Make WordPress Core

Ticket #29814: 29814.patch

File 29814.patch, 1.9 KB (added by DeBAAT, 11 years ago)

Patch for file wp-admin/options-general.php - #29814

  • .php

    old new $languages = get_available_languages(); 
    308308if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
    309309        $languages[] = WPLANG;
    310310}
    311 if ( $languages ) {
    312311        ?>
    313312        <tr>
    314313                <th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
    315314                <td>
    316315                        <?php
    317                         $locale = get_locale();
    318                         if ( ! in_array( $locale, $languages ) ) {
    319                                 $locale = '';
     316                        if ( $languages ) {
     317                                $locale = get_locale();
     318                                if ( ! in_array( $locale, $languages ) ) {
     319                                        $locale = '';
     320                                }
     321
     322                                wp_dropdown_languages( array(
     323                                        'name'      => 'WPLANG',
     324                                        'id'        => 'WPLANG',
     325                                        'selected'  => $locale,
     326                                        'languages' => $languages,
     327                                ) );
     328                        } else {
     329                                if ( is_super_admin() ) {
     330                                        ?>
     331                                        <p class="description">
     332                                                <strong><?php _e( 'Note:' ); ?></strong>
     333                                                        <?php
     334                                                                printf( '<br/>' );
     335                                                                printf( __( 'This site currently only supports the U.S. English default language.' ) );
     336                                                                printf( '<br/>' );
     337                                                                printf( __( 'More information on multi-language support can be found <a href="%s">here</a>.' ), 'http://codex.wordpress.org/Installing_WordPress_in_Your_Language' );
     338                                                        ?>
     339                                        </p>
     340                                        <?php
     341                                }
    320342                        }
    321343
    322                         wp_dropdown_languages( array(
    323                                 'name'      => 'WPLANG',
    324                                 'id'        => 'WPLANG',
    325                                 'selected'  => $locale,
    326                                 'languages' => $languages,
    327                         ) );
    328 
    329344                        // Add note about deprecated WPLANG constant.
    330345                        if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
    331346                                if ( is_super_admin() ) {
    if ( ! is_multisite() && defined( 'WPLANG' ) && '' 
    341356                </td>
    342357        </tr>
    343358        <?php
    344 }
    345359?>
    346360</table>
    347361