mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@29630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -302,23 +302,43 @@ endfor;
|
||||
</select></td>
|
||||
</tr>
|
||||
<?php do_settings_fields('general', 'default'); ?>
|
||||
|
||||
<?php
|
||||
$languages = get_available_languages();
|
||||
if ( $languages ) :
|
||||
?>
|
||||
$languages = get_available_languages();
|
||||
if ( ! empty( $languages ) ) {
|
||||
?>
|
||||
<tr>
|
||||
<th width="33%" scope="row"><label for="WPLANG"><?php _e('Site Language') ?></label></th>
|
||||
<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
|
||||
<td>
|
||||
<?php wp_dropdown_languages( array(
|
||||
<?php
|
||||
$locale = get_locale();
|
||||
if ( ! in_array( $locale, $languages ) ) {
|
||||
$locale = '';
|
||||
}
|
||||
|
||||
wp_dropdown_languages( array(
|
||||
'name' => 'WPLANG',
|
||||
'id' => 'WPLANG',
|
||||
'selected' => get_option( 'WPLANG' ),
|
||||
'selected' => $locale,
|
||||
'languages' => $languages,
|
||||
) ); ?>
|
||||
) );
|
||||
|
||||
// Add note about deprecated WPLANG constant.
|
||||
if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) {
|
||||
if ( is_super_admin() ) {
|
||||
?>
|
||||
<p class="description">
|
||||
<strong><?php _e( 'Note:' ); ?></strong> <?php printf( __( 'The %s constant in your %s file is no longer needed.' ), '<code>WPLANG</code>', '<code>wp-config.php</code>' ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
_deprecated_argument( 'define()', '4.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user