Ticket #19852: load_default_textdomain.diff
File load_default_textdomain.diff, 1.4 KB (added by , 13 years ago) |
---|
-
wp-includes/l10n.php
372 372 /** 373 373 * Loads default translated strings based on locale. 374 374 * 375 * Loads the .mo file in WP_LANG_DIR constant path from WordPress root. The376 * translated (.mo) file isnamed 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. 377 377 * 378 378 * @since 1.5.0 379 379 */ 380 380 function load_default_textdomain() { 381 global $pagenow; 381 382 $locale = get_locale(); 382 383 383 384 load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" ); 384 385 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" ) ) { 386 387 load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" ); 387 388 return; 388 389 } 389 390 390 if ( is_admin() )391 if ( is_admin() || 'wp-login.php' == $pagenow ) 391 392 load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" ); 392 393 393 if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ))394 if ( is_network_admin() || 'network.php' == $pagenow ) 394 395 load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" ); 395 396 396 } 397 397 398 398 /**