Ticket #36015: 36015.2.patch
File 36015.2.patch, 1.6 KB (added by , 9 years ago) |
---|
-
tools/i18n/extract.php
172 172 if ( T_COMMENT == $id ) { 173 173 $text = preg_replace( '%^\s+\*\s%m', '', $text ); 174 174 $text = str_replace( array( "\r\n", "\n" ), ' ', $text );; 175 $text = trim( preg_replace( '%^ /\*|//%', '', preg_replace( '%\*/$%', '', $text ) ) );175 $text = trim( preg_replace( '%^(/\*|//)%', '', preg_replace( '%\*/$%', '', $text ) ) ); 176 176 if ( 0 === stripos( $text, $this->comment_prefix ) ) { 177 177 $latest_comment = $text; 178 178 } -
tools/i18n/t/ExtractTest.php
186 186 /** 187 187 * @group comment 188 188 */ 189 function test_find_function_calls_with_url_in_comment() { 190 $this->assertEquals( array( array( 191 'name' => '__', 'args' => array( 'F j, Y g:i a' ), 'line' => 3, 192 'comment' => 'translators: localized date and time format, see http://php.net/date' 193 ) ), 194 $this->extractor->find_function_calls( array( '__' ), 195 "<?php 196 /* translators: localized date and time format, see http://php.net/date */ 197 __( 'F j, Y g:i a' );" 198 ) 199 ); 200 } 201 202 /** 203 * @group comment 204 */ 189 205 function test_comment_prefix_should_be_case_insensitive() { 190 206 $this->assertEquals( 191 207 array( array( 'name' => 'f', 'args' => array( 'baba' ), 'line' => 1, 'comment' => 'Translators: let your ears fly!' ) ),