WordPress.org

Make WordPress Core

Ticket #19852: 19852.3.diff

File 19852.3.diff, 1.5 KB (added by ryan, 8 years ago)

Now with less bugs

  • wp-includes/l10n.php

     
    382382
    383383        load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
    384384
    385         if ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {
     385        if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists(  WP_LANG_DIR . "/admin-$locale.mo" ) ) {
    386386                load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );
     387                return;
    387388        }
     389
     390        if ( is_admin()  )
     391                load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
     392
     393        if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
     394                load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" );
     395
    388396}
    389397
    390398/**
  • wp-admin/includes/admin.php

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