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.
Built from https://develop.svn.wordpress.org/trunk@29630
git-svn-id: http://core.svn.wordpress.org/trunk@29404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -151,7 +151,7 @@ if ( 'update' == $action ) {
|
||||
$options = $whitelist_options[ $option_page ];
|
||||
}
|
||||
|
||||
// Handle custom date/time formats
|
||||
// Handle custom date/time formats.
|
||||
if ( 'general' == $option_page ) {
|
||||
if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['date_format'] ) )
|
||||
$_POST['date_format'] = $_POST['date_format_custom'];
|
||||
@@ -180,6 +180,14 @@ if ( 'update' == $action ) {
|
||||
}
|
||||
update_option( $option, $value );
|
||||
}
|
||||
|
||||
// Switch translation in case WPLANG was changed.
|
||||
$language = get_option( 'WPLANG' );
|
||||
if ( $language ) {
|
||||
load_default_textdomain( $language );
|
||||
} else {
|
||||
unload_textdomain( 'default' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user