Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -424,6 +424,7 @@ |
425 | 425 | |
426 | 426 | $code = $this->targetLanguage; |
427 | 427 | $definition = trim( strval( $this->getDefinition() ) ); |
| 428 | + $definition = str_replace( "\n", "<newline/>", $definition ); |
428 | 429 | |
429 | 430 | $memckey = wfMemckey( 'translate-tmsug-badcodes-' . $serviceName ); |
430 | 431 | $unsupported = $wgMemc->get( $memckey ); |
— | — | @@ -471,6 +472,7 @@ |
472 | 473 | $ret = $req->getContent(); |
473 | 474 | $text = preg_replace( '~<string.*>(.*)</string>~', '\\1', $ret ); |
474 | 475 | $text = Sanitizer::decodeCharReferences( $text ); |
| 476 | + $text = trim( preg_replace( "~\s*<newline></newline>\s*~", "\n", $text ) ); |
475 | 477 | $text = $this->suggestionField( $text ); |
476 | 478 | return Html::rawElement( 'div', null, self::legend( $serviceName ) . $text . self::clear() ); |
477 | 479 | } |