I18N: Move "Site Language" setting above "Timezone".

This brings all locale-specific site settings closer together and prevents the language setting from being pushed down by unrelated settings added by plugins.

Props johnjamesjacoby.
Fixes #38562.
Built from https://develop.svn.wordpress.org/trunk@39885


git-svn-id: http://core.svn.wordpress.org/trunk@39822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-01-12 04:28:40 +00:00
parent 32564f9332
commit a4f106ff9d
2 changed files with 45 additions and 46 deletions

View File

@ -120,7 +120,50 @@ if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
<?php endif; ?>
</td>
</tr>
<?php } ?>
<?php }
$languages = get_available_languages();
$translations = wp_get_available_translations();
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
$languages[] = WPLANG;
}
if ( ! empty( $languages ) || ! empty( $translations ) ) {
?>
<tr>
<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
<td>
<?php
$locale = get_locale();
if ( ! in_array( $locale, $languages ) ) {
$locale = '';
}
wp_dropdown_languages( array(
'name' => 'WPLANG',
'id' => 'WPLANG',
'selected' => $locale,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
) );
// 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.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<?php
$current_offset = get_option('gmt_offset');
@ -317,50 +360,6 @@ endfor;
</select></td>
</tr>
<?php do_settings_fields('general', 'default'); ?>
<?php
$languages = get_available_languages();
$translations = wp_get_available_translations();
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
$languages[] = WPLANG;
}
if ( ! empty( $languages ) || ! empty( $translations ) ) {
?>
<tr>
<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
<td>
<?php
$locale = get_locale();
if ( ! in_array( $locale, $languages ) ) {
$locale = '';
}
wp_dropdown_languages( array(
'name' => 'WPLANG',
'id' => 'WPLANG',
'selected' => $locale,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
) );
// 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.0', sprintf( __( 'The %s constant in your %s file is no longer needed.' ), 'WPLANG', 'wp-config.php' ) );
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php do_settings_sections('general'); ?>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39884';
$wp_version = '4.8-alpha-39885';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.