Ticket #18960: 18960.3.diff
| File 18960.3.diff, 1.3 KB (added by , 14 years ago) |
|---|
-
wp-includes/l10n.php
459 459 function load_theme_textdomain( $domain, $path = false ) { 460 460 $locale = apply_filters( 'theme_locale', get_locale(), $domain ); 461 461 462 $path = ( empty( $path ) ) ? get_template_directory() : $path; 462 if ( empty( $path ) ) 463 $path = get_template_directory(); 463 464 464 $mofile = "$path/$locale.mo"; 465 // Load the textdomain from the Theme provided location, or theme directory first 466 $mofile = "{$path}/{$locale}.mo"; 467 if ( $loaded = load_textdomain($domain, $mofile) ) 468 return $loaded; 469 470 // Else, load textdomain from the Language directory 471 $mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo"; 465 472 return load_textdomain($domain, $mofile); 466 473 } 467 474 … … 478 485 * @param string $domain Unique identifier for retrieving translated strings 479 486 */ 480 487 function load_child_theme_textdomain( $domain, $path = false ) { 481 $locale = apply_filters( 'theme_locale', get_locale(), $domain ); 482 483 $path = ( empty( $path ) ) ? get_stylesheet_directory() : $path; 484 485 $mofile = "$path/$locale.mo"; 486 return load_textdomain($domain, $mofile); 488 if ( empty( $path ) ) 489 $path = get_stylesheet_directory(); 490 return load_theme_textdomain( $domain, $path ); 487 491 } 488 492 489 493 /**