Index: trunk/extensions/LiveTranslate/includes/LT_LTFParser.php |
— | — | @@ -22,10 +22,24 @@ |
23 | 23 | |
24 | 24 | $translationSets = array(); |
25 | 25 | |
| 26 | + $text = preg_replace( '/\\<!--([^(--\\>)]*)--\\>/', '', $text ); |
26 | 27 | $lines = explode( "\n", $text ); |
27 | | - $languages = array_map( 'trim', explode( ',', array_shift( $lines ) ) ); |
28 | 28 | |
| 29 | + while ( true ) { |
| 30 | + $languages = array_shift( $lines ); |
| 31 | + |
| 32 | + if ( trim( $languages ) != '' ) { |
| 33 | + break; |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + $languages = array_map( 'trim', explode( ',', $languages ) ); |
| 38 | + |
29 | 39 | foreach ( $lines as $line ) { |
| 40 | + if ( trim( $line ) == '' ) { |
| 41 | + continue; |
| 42 | + } |
| 43 | + |
30 | 44 | $values = array_map( 'trim', explode( ',', $line ) ); |
31 | 45 | $tu = new LTTMUnit(); |
32 | 46 | |
Index: trunk/extensions/LiveTranslate/api/ApiImportTranslationMemories.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | ); |
49 | 49 | |
50 | 50 | foreach ( $res as $tm ) { |
51 | | - if ( $tm->memory_local != "0" ) { |
| 51 | + if ( $tm->memory_local != '0' ) { |
52 | 52 | // Obtain the contents of the article. |
53 | 53 | $title = Title::newFromText( $location, NS_MAIN ); |
54 | 54 | |