Changeset 37440
- Timestamp:
- 05/16/2016 03:09:33 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r37416 r37440 849 849 function get_translations_for_domain( $domain ) { 850 850 global $l10n; 851 if ( isset( $l10n[ $domain ] ) || _load_textdomain_just_in_time( $domain) ) {851 if ( isset( $l10n[ $domain ] ) || ( _load_textdomain_just_in_time( $domain ) && isset( $l10n[ $domain ] ) ) ) { 852 852 return $l10n[ $domain ]; 853 853 } -
trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
r37415 r37440 59 59 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-plugin' ); 60 60 61 unload_textdomain( 'internationalized-plugin' ); 61 62 remove_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 62 63 … … 80 81 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-theme' ); 81 82 83 unload_textdomain( 'internationalized-theme' ); 82 84 remove_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 83 85 … … 86 88 $this->assertTrue( $is_textdomain_loaded_after ); 87 89 } 90 91 /** 92 * @ticket 341142 93 */ 94 public function test_get_translations_for_domain_does_not_return_null_if_override_load_textdomain_is_used() { 95 add_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 96 add_filter( 'override_load_textdomain', '__return_true' ); 97 $translations = get_translations_for_domain( 'internationalized-plugin' ); 98 remove_filter( 'override_load_textdomain', '__return_true' ); 99 remove_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 100 101 $this->assertTrue( $translations instanceof NOOP_Translations ); 102 } 88 103 }
Note: See TracChangeset
for help on using the changeset viewer.