From c064c285aaedd017c75ba313250201f4b158b15b Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 21 Aug 2008 22:16:44 +0000 Subject: [PATCH] Start to improve HTMLDiff.php localization. For the time being, I recommend that the messages *not* be localized, because they're likely to change form quite a bit more before they're stable. Someone might want to temporarily mark them "do not change" and have BetaWiki not pick them up. I'd appreciate help on this, of course. --- includes/HTMLDiff.php | 21 ++++++++++++--------- languages/messages/MessagesEn.php | 9 +++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/includes/HTMLDiff.php b/includes/HTMLDiff.php index ef9e0aabad..ec076b9262 100644 --- a/includes/HTMLDiff.php +++ b/includes/HTMLDiff.php @@ -1215,7 +1215,7 @@ class TagToString { $tagDescription = $this->node->qName; } if ($this->sem == TagToStringFactory::MOVED) { - $txt->addHtml( wfMsgExt( 'diff-movedoutof' , 'parseinline' ) . ' ' . $tagDescription ); + $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) ); } else if ($this->sem == TagToStringFactory::STYLE) { $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleremoved' , 'parseinline' ) ); } else { @@ -1231,11 +1231,11 @@ class TagToString { $tagDescription = $this->node->qName; } if ($this->sem == TagToStringFactory::MOVED) { - $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline' ) . ' ' . $tagDescription); + $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) ); } else if ($this->sem == TagToStringFactory::STYLE) { - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleadded', 'parseinline' ) ); + $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleadded', 'parseinline' ) ); } else { - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-added', 'parseinline' ) ); + $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-added', 'parseinline' ) ); } $this->addAttributes($txt, $this->node->attributes); $txt->addHtml('.'); @@ -1253,16 +1253,19 @@ class TagToString { $attr = $attributes[$key]; if($firstOne) { $firstOne = false; - $txt->addHtml(' ' . wfMsgExt('diff-with', 'parseinline' ) . ' ' . $this->translateArgument($key) . ' ' - . htmlspecialchars($attr)); + $txt->addHtml( wfMsgExt('diff-with', 'escapenoentities', $this->translateArgument($key), htmlspecialchars($attr) ) ); continue; } - $txt->addHtml(', ' . $this->translateArgument($key) . ' ' . htmlspecialchars($attr)); + $txt->addHtml( wfMsgExt( 'comma-separator', 'escapenoentities' ) . + wfMsgExt( 'diff-with-additional', 'escapenoentities', + $this->translateArgument( $key ), htmlspecialchars( $attr ) ) + ); } if ($nbAttributes_min_1 > 0) { - $txt->addHtml(' ' . wfMsgExt('diff-and', 'parseinline' ) . ' ' . $this->translateArgument($keys[$nbAttributes_min_1]) . ' ' - . htmlspecialchars($attributes[$keys[$nbAttributes_min_1]])); + $txt->addHtml( wfMsgExt( 'diff-with-final', 'escapenoentities', + $this->translateArgument($keys[$nbAttributes_min_1]), + htmlspecialchars($attributes[$keys[$nbAttributes_min_1]]) ) ); } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 12cd59099e..90989dbe3e 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1331,18 +1331,19 @@ Note that using the navigation links will reset this column.', 'wikicodecomparison' => 'Wikitext comparison', 'editundo' => 'undo', 'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown.)', -'diff-movedto' => 'moved to', +'diff-movedto' => 'moved to $1', 'diff-styleadded' => 'style added', 'diff-added' => 'added', 'diff-changedto' => 'changed to', -'diff-movedoutof' => 'moved out of', +'diff-movedoutof' => 'moved out of $1', 'diff-styleremoved' => 'style removed', 'diff-removed' => 'removed', 'diff-changedfrom' => 'changed from', 'diff-src' => 'source', 'diff-withdestination' => 'with destination', -'diff-and' => 'and', -'diff-with' => 'with', +'diff-with' => ' with $1 $2', +'diff-with-additional' => '$1 $2', +'diff-with-final' => ' and $1 $2', 'diff-width' => 'width', 'diff-height' => 'height', 'diff-p' => "a '''paragraph'''", -- 2.20.1