Clean up some of the i18n stuff in HTMLDiff. Still not perfect, but better.
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 13 Sep 2008 06:50:56 +0000 (06:50 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 13 Sep 2008 06:50:56 +0000 (06:50 +0000)
includes/diff/HTMLDiff.php
languages/messages/MessagesEn.php

index 8a162c1..8af4a27 100644 (file)
@@ -772,9 +772,9 @@ class TagToString {
                if ($this->sem == TagToStringFactory::MOVED) {
                        $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) );
                } else if ($this->sem == TagToStringFactory::STYLE) {
-                       $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleremoved' , 'parseinline' ) );
+                       $txt->addHtml( wfMsgExt( 'diff-styleremoved' , 'parseinline', $tagDescription ) );
                } else {
-                       $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-removed' , 'parseinline' ) );
+                       $txt->addHtml( wfMsgExt( 'diff-removed' , 'parseinline', $tagDescription ) );
                }
                $this->addAttributes($txt, $this->node->attributes);
                $txt->addHtml('.');
@@ -788,9 +788,9 @@ class TagToString {
                if ($this->sem == TagToStringFactory::MOVED) {
                        $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) );
                } else if ($this->sem == TagToStringFactory::STYLE) {
-                       $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleadded', 'parseinline' ) );
+                       $txt->addHtml( wfMsgExt( 'diff-styleadded', 'parseinline', $tagDescription ) );
                } else {
-                       $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-added', 'parseinline' ) );
+                       $txt->addHtml( wfMsgExt( 'diff-added', 'parseinline', $tagDescription ) );
                }
                $this->addAttributes($txt, $this->node->attributes);
                $txt->addHtml('.');
@@ -844,13 +844,13 @@ class NoContentTagToString extends TagToString {
                if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
                        $tagDescription = "&lt;" . $this->node->qName . "&gt;";
                }
-               $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline' ) . ' ' . $tagDescription);
+               $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline', $tagDescription ) );
                $this->addAttributes($txt, $this->node->attributes);
                $txt->addHtml('.');
        }
 
        public function getRemovedDescription(ChangeText $txt) {
-               $txt->addHtml( wfMsgExt('diff-changedfrom', 'parseinline' ) . ' ' . $tagDescription);
+               $txt->addHtml( wfMsgExt('diff-changedfrom', 'parseinline', $tagDescription ) );
                $this->addAttributes($txt, $this->node->attributes);
                $txt->addHtml('.');
        }
@@ -864,7 +864,7 @@ class AnchorToString extends TagToString {
 
        protected function addAttributes(ChangeText $txt, array $attributes) {
                if (array_key_exists('href', $attributes)) {
-                       $txt->addHtml(' ' . wfMsgExt( 'diff-withdestination', 'parseinline' ) . ' ' . htmlspecialchars($attributes['href']));
+                       $txt->addHtml(' ' . wfMsgExt( 'diff-withdestination', 'parseinline', htmlspecialchars($attributes['href']) ) );
                        unset($attributes['href']);
                }
                parent::addAttributes($txt, $attributes);
index edc5a9b..e5426e6 100644 (file)
@@ -1344,15 +1344,15 @@ Note that using the navigation links will reset this column.',
 'editundo'                => 'undo',
 'diff-multi'              => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown.)',
 'diff-movedto'            => 'moved to $1',
-'diff-styleadded'         => 'style added',
-'diff-added'              => 'added',
-'diff-changedto'          => 'changed to',
+'diff-styleadded'         => '$1 style added',
+'diff-added'              => '$1 added',
+'diff-changedto'          => 'changed to $1',
 'diff-movedoutof'         => 'moved out of $1',
-'diff-styleremoved'       => 'style removed',
-'diff-removed'            => 'removed',
-'diff-changedfrom'        => 'changed from',
+'diff-styleremoved'       => '$1 style removed',
+'diff-removed'            => '$1 removed',
+'diff-changedfrom'        => 'changed from $1',
 'diff-src'                => 'source',
-'diff-withdestination'    => 'with destination',
+'diff-withdestination'    => 'with destination $1',
 'diff-with'               => '&#32;with $1 $2',
 'diff-with-additional'    => '$1 $2', # only translate this message to other languages if you have to change it
 'diff-with-final'         => '&#32;and $1 $2',