Load the new admin and network admin mo files, if present. see #19852

git-svn-id: https://develop.svn.wordpress.org/trunk@19772 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-01-27 22:19:56 +00:00
parent 30889de384
commit 4b5b2e4658
2 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,13 @@
* @subpackage Administration
*/
if ( ! defined('WP_ADMIN') ) {
// This file is being included from a file other than wp-admin/admin.php, so
// some setup was skipped. Make sure the admin message catalog is loaded since
// load_default_textdomain() will not have done so in this context.
load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
}
/** WordPress Bookmark Administration API */
require_once(ABSPATH . 'wp-admin/includes/bookmark.php');

View File

@ -382,9 +382,17 @@ function load_default_textdomain() {
load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
if ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {
if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists( WP_LANG_DIR . "/admin-$locale.mo" ) ) {
load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );
return;
}
if ( is_admin() )
load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" );
}
/**