Make WordPress Core

Ticket #19852: load_default_textdomain.diff

File load_default_textdomain.diff, 1.4 KB (added by nacin, 13 years ago)
  • wp-includes/l10n.php

     
    372372/**
    373373 * Loads default translated strings based on locale.
    374374 *
    375  * Loads the .mo file in WP_LANG_DIR constant path from WordPress root. The
    376  * translated (.mo) file is named based on the locale.
     375 * Loads the .mo files in WP_LANG_DIR constant path from WordPress root. The
     376 * translated (.mo) files are named based on the locale.
    377377 *
    378378 * @since 1.5.0
    379379 */
    380380function load_default_textdomain() {
     381        global $pagenow;
    381382        $locale = get_locale();
    382383
    383384        load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
    384385
    385         if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists( WP_LANG_DIR . "/admin-$locale.mo" ) ) {
     386        if ( ( is_multisite() || 'network.php' == $pagenow ) && ! file_exists( WP_LANG_DIR . "/admin-$locale.mo" ) ) {
    386387                load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );
    387388                return;
    388389        }
    389390
    390         if ( is_admin() )
     391        if ( is_admin() || 'wp-login.php' == $pagenow )
    391392                load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
    392393
    393         if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
     394        if ( is_network_admin() || 'network.php' == $pagenow )
    394395                load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" );
    395 
    396396}
    397397
    398398/**