Changeset 25059
- Timestamp:
- 08/20/2013 12:33:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r24825 r25059 448 448 } 449 449 450 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 450 // Load the textdomain according to the plugin first 451 $mofile = $domain . '-' . $locale . '.mo'; 452 if ( $loaded = load_textdomain( $domain, $path . '/'. $mofile ) ) 453 return $loaded; 454 455 // Otherwise, load from the languages directory 456 $mofile = WP_LANG_DIR . '/plugins/' . $mofile; 451 457 return load_textdomain( $domain, $mofile ); 452 458 } … … 463 469 function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) { 464 470 $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); 465 $path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ); 466 load_textdomain( $domain, trailingslashit( $path ) . "$domain-$locale.mo" ); 471 $path = trailingslashit( WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' ) ); 472 473 // Load the textdomain according to the plugin first 474 $mofile = $domain . '-' . $locale . '.mo'; 475 if ( $loaded = load_textdomain( $domain, $path . $mofile ) ) 476 return $loaded; 477 478 // Otherwise, load from the languages directory 479 $mofile = WP_LANG_DIR . '/plugins/' . $mofile; 480 return load_textdomain( $domain, $mofile ); 467 481 } 468 482 … … 485 499 $path = get_template_directory(); 486 500 487 // Load the textdomain from the Theme provided location, or theme directory first501 // Load the textdomain according to the theme 488 502 $mofile = "{$path}/{$locale}.mo"; 489 if ( $loaded = load_textdomain( $domain, $mofile) )503 if ( $loaded = load_textdomain( $domain, $mofile ) ) 490 504 return $loaded; 491 505 492 // Else, load textdomain from the Languagedirectory506 // Otherwise, load from the languages directory 493 507 $mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo"; 494 return load_textdomain( $domain, $mofile);508 return load_textdomain( $domain, $mofile ); 495 509 } 496 510
Note: See TracChangeset
for help on using the changeset viewer.