Ticket #26638: l10n-false.patch
File l10n-false.patch, 1.2 KB (added by , 11 years ago) |
---|
-
wp-includes/l10n.php
72 72 */ 73 73 function translate( $text, $domain = 'default' ) { 74 74 $translations = get_translations_for_domain( $domain ); 75 76 if ($translations == false) { 77 return apply_filters( 'gettext', $text, $text, $domain ); 78 } 79 80 var_dump($translations); 81 75 82 $translations = $translations->translate( $text ); 76 83 /** 77 84 * Filter text with its translation. … … 119 126 */ 120 127 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 121 128 $translations = get_translations_for_domain( $domain ); 122 $translations = $translations->translate( $text, $context ); 129 130 if ($translations === false) { 131 $translations = $text; 132 } else { 133 $translations = $translations->translate( $text, $context ); 134 } 123 135 /** 124 136 * Filter text with its translation based on context information. 125 137 * … … 675 687 function get_translations_for_domain( $domain ) { 676 688 global $l10n; 677 689 if ( !isset( $l10n[$domain] ) ) { 678 $l10n[$domain] = new NOOP_Translations;690 $l10n[$domain] = false; 679 691 } 680 692 return $l10n[$domain]; 681 693 }