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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-01-27 22:19:56 +00:00
parent 017f5e4aeb
commit b2d61dab8a
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" );
}
/**