Changeset 36781
- Timestamp:
- 02/29/2016 08:44:31 PM (9 years ago)
- Location:
- trunk/tools/i18n
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/i18n/extract.php
r31498 r36781 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; -
trunk/tools/i18n/t/ExtractTest.php
r31498 r36781 187 187 * @group comment 188 188 */ 189 function test_find_function_calls_with_c_style_comment() { 190 $this->assertEquals( array( array( 191 'name' => '__', 'args' => array( 'on' ), 'line' => 3, 192 'comment' => 'translators: let your ears fly!' 193 ) ), 194 $this->extractor->find_function_calls( array( '__' ), 195 "<?php 196 // translators: let your ears fly! 197 __( 'on' );" 198 ) 199 ); 200 } 201 202 /** 203 * @group comment 204 */ 205 function test_find_function_calls_with_url_in_comment() { 206 $this->assertEquals( array( array( 207 'name' => '__', 'args' => array( 'F j, Y g:i a' ), 'line' => 3, 208 'comment' => 'translators: localized date and time format, see http://php.net/date' 209 ) ), 210 $this->extractor->find_function_calls( array( '__' ), 211 "<?php 212 /* translators: localized date and time format, see http://php.net/date */ 213 __( 'F j, Y g:i a' );" 214 ) 215 ); 216 } 217 218 /** 219 * @group comment 220 */ 189 221 function test_comment_prefix_should_be_case_insensitive() { 190 222 $this->assertEquals(
Note: See TracChangeset
for help on using the changeset viewer.