Plugins: In _get_plugin_data_markup_translate() don't reload translations if they're already loaded.

Props jrf.
Fixes #35439.
Built from https://develop.svn.wordpress.org/trunk@36282


git-svn-id: http://core.svn.wordpress.org/trunk@36249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-01-13 13:04:27 +00:00
parent 2d136ce421
commit a51129c2a6
2 changed files with 8 additions and 5 deletions

View File

@ -117,10 +117,13 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
// Translate fields // Translate fields
if ( $translate ) { if ( $translate ) {
if ( $textdomain = $plugin_data['TextDomain'] ) { if ( $textdomain = $plugin_data['TextDomain'] ) {
if ( $plugin_data['DomainPath'] ) if ( ! is_textdomain_loaded( $textdomain ) ) {
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); if ( $plugin_data['DomainPath'] ) {
else load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); } else {
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
}
}
} elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) { } elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) {
$textdomain = 'default'; $textdomain = 'default';
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-36279'; $wp_version = '4.5-alpha-36282';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.