Make WordPress Core


Ignore:
Timestamp:
08/26/2014 07:58:33 PM (9 years ago)
Author:
ocean90
Message:

Language packs: No WPLANG anymore.

  • The WPLANG constant is no longer needed. Remove define('WPLANG', ); from wp-config-sample.php. Populate WPLANG option based on the WPLANG constant. When get_option('WPLANG') is an empty string it will override WPLANG.
  • Introduce translations_api() which is available to communicate with the translation API. Move translation install related functions to a new file.
  • Replace mu_dropdown_languages() with wp_dropdown_languages(). wp_dropdown_languages() is now populated by the translation API.
  • Remove wp_install_load_language() and allow load_default_textdomain() to switch a core translation.

fixes #13069, #15677, #19760, #28730, #29281.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/settings.php

    r29030 r29630  
    103103                    <p class="description">
    104104                        <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
    105                     </p>   
     105                    </p>
    106106                </td>
    107107            </tr>
     
    166166                    <p class="description">
    167167                        <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
    168                     </p>   
     168                    </p>
    169169                </td>
    170170            </tr>
     
    232232                    <p class="description">
    233233                        <?php _e( 'The first comment on a new site.' ) ?>
    234                     </p>   
     234                    </p>
    235235                </td>
    236236            </tr>
     
    274274        </table>
    275275
    276 <?php
     276        <?php
    277277        $languages = get_available_languages();
    278278        if ( ! empty( $languages ) ) {
    279             $lang = get_site_option( 'WPLANG' );
    280 ?>
    281         <h3><?php _e( 'Language Settings' ); ?></h3>
    282         <table class="form-table">
     279            ?>
     280            <h3><?php _e( 'Language Settings' ); ?></h3>
     281            <table class="form-table">
    283282                <tr>
    284283                    <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
    285284                    <td>
    286                         <select name="WPLANG" id="WPLANG">
    287                             <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
    288                         </select>
     285                        <?php
     286                        $lang = get_site_option( 'WPLANG' );
     287                        if ( ! in_array( $lang, $languages ) ) {
     288                            $lang = '';
     289                        }
     290
     291                        wp_dropdown_languages( array(
     292                            'name'      => 'WPLANG',
     293                            'id'        => 'WPLANG',
     294                            'selected'  => $lang,
     295                            'languages' => $languages,
     296                        ) );
     297                        ?>
    289298                    </td>
    290299                </tr>
    291         </table>
    292 <?php
    293         } // languages
    294 ?>
     300            </table>
     301            <?php
     302        }
     303        ?>
    295304
    296305        <h3><?php _e( 'Menu Settings' ); ?></h3>
     
    325334        </table>
    326335
    327         <?php 
     336        <?php
    328337        /**
    329338         * Fires at the end of the Network Settings form, before the submit button.
Note: See TracChangeset for help on using the changeset viewer.