Ticket #30972: 30972.patch
File 30972.patch, 1.8 KB (added by , 10 years ago) |
---|
-
tools/i18n/extract.php
170 170 continue; 171 171 } 172 172 if ( T_COMMENT == $id ) { 173 $text = preg_replace( '%^\s+\*\s%m', '', $text ); 174 $text = str_replace( array( "\r\n", "\n" ), ' ', $text );; 173 175 $text = trim( preg_replace( '%^/\*|//%', '', preg_replace( '%\*/$%', '', $text ) ) ); 174 176 if ( 0 === stripos( $text, $this->comment_prefix ) ) { 175 177 $latest_comment = $text; -
tools/i18n/t/ExtractTest.php
152 152 $this->extractor->find_function_calls( array('f'), '<?php /* translators: boo */ /* translators: let your ears fly! */ /* baba */ $foo = g ( f( "baba" ) ); ' ) ); 153 153 } 154 154 155 function test_find_function_calls_with_multi_line_comment() { 156 $this->assertEquals( array( array( 157 'name' => 'f', 'args' => array( 'baba' ), 'line' => 6, 158 'comment' => "Translators: If there are characters in your language that are not supported by Lato, translate this to 'off'. Do not translate into your own language." 159 ) ), 160 $this->extractor->find_function_calls( array('f'), 161 "<?php 162 /* 163 * Translators: If there are characters in your language that are not supported 164 * by Lato, translate this to 'off'. Do not translate into your own language. 165 */ 166 f( 'baba' );" 167 ) 168 ); 169 } 170 155 171 function test_comment_prefix_should_be_case_insensitive() { 156 172 $this->assertEquals( 157 173 array( array( 'name' => 'f', 'args' => array( 'baba' ), 'line' => 1, 'comment' => 'Translators: let your ears fly!' ) ),