r40774 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40773‎ | r40774 | r40775 >
Date:06:50, 13 September 2008
Author:demon
Status:old
Tags:
Comment:
Clean up some of the i18n stuff in HTMLDiff. Still not perfect, but better.
Modified paths:
  • /trunk/phase3/includes/diff/HTMLDiff.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/HTMLDiff.php
@@ -772,9 +772,9 @@
773773 if ($this->sem == TagToStringFactory::MOVED) {
774774 $txt->addHtml( wfMsgExt( 'diff-movedoutof', 'parseinline', $tagDescription ) );
775775 } else if ($this->sem == TagToStringFactory::STYLE) {
776 - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleremoved' , 'parseinline' ) );
 776+ $txt->addHtml( wfMsgExt( 'diff-styleremoved' , 'parseinline', $tagDescription ) );
777777 } else {
778 - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-removed' , 'parseinline' ) );
 778+ $txt->addHtml( wfMsgExt( 'diff-removed' , 'parseinline', $tagDescription ) );
779779 }
780780 $this->addAttributes($txt, $this->node->attributes);
781781 $txt->addHtml('.');
@@ -788,9 +788,9 @@
789789 if ($this->sem == TagToStringFactory::MOVED) {
790790 $txt->addHtml( wfMsgExt( 'diff-movedto' , 'parseinline', $tagDescription) );
791791 } else if ($this->sem == TagToStringFactory::STYLE) {
792 - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-styleadded', 'parseinline' ) );
 792+ $txt->addHtml( wfMsgExt( 'diff-styleadded', 'parseinline', $tagDescription ) );
793793 } else {
794 - $txt->addHtml($tagDescription . ' ' . wfMsgExt( 'diff-added', 'parseinline' ) );
 794+ $txt->addHtml( wfMsgExt( 'diff-added', 'parseinline', $tagDescription ) );
795795 }
796796 $this->addAttributes($txt, $this->node->attributes);
797797 $txt->addHtml('.');
@@ -844,13 +844,13 @@
845845 if( wfEmptyMsg( 'diff-' . $this->node->qName, $tagDescription ) ){
846846 $tagDescription = "<" . $this->node->qName . ">";
847847 }
848 - $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline' ) . ' ' . $tagDescription);
 848+ $txt->addHtml( wfMsgExt('diff-changedto', 'parseinline', $tagDescription ) );
849849 $this->addAttributes($txt, $this->node->attributes);
850850 $txt->addHtml('.');
851851 }
852852
853853 public function getRemovedDescription(ChangeText $txt) {
854 - $txt->addHtml( wfMsgExt('diff-changedfrom', 'parseinline' ) . ' ' . $tagDescription);
 854+ $txt->addHtml( wfMsgExt('diff-changedfrom', 'parseinline', $tagDescription ) );
855855 $this->addAttributes($txt, $this->node->attributes);
856856 $txt->addHtml('.');
857857 }
@@ -864,7 +864,7 @@
865865
866866 protected function addAttributes(ChangeText $txt, array $attributes) {
867867 if (array_key_exists('href', $attributes)) {
868 - $txt->addHtml(' ' . wfMsgExt( 'diff-withdestination', 'parseinline' ) . ' ' . htmlspecialchars($attributes['href']));
 868+ $txt->addHtml(' ' . wfMsgExt( 'diff-withdestination', 'parseinline', htmlspecialchars($attributes['href']) ) );
869869 unset($attributes['href']);
870870 }
871871 parent::addAttributes($txt, $attributes);
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1344,15 +1344,15 @@
13451345 'editundo' => 'undo',
13461346 'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown.)',
13471347 'diff-movedto' => 'moved to $1',
1348 -'diff-styleadded' => 'style added',
1349 -'diff-added' => 'added',
1350 -'diff-changedto' => 'changed to',
 1348+'diff-styleadded' => '$1 style added',
 1349+'diff-added' => '$1 added',
 1350+'diff-changedto' => 'changed to $1',
13511351 'diff-movedoutof' => 'moved out of $1',
1352 -'diff-styleremoved' => 'style removed',
1353 -'diff-removed' => 'removed',
1354 -'diff-changedfrom' => 'changed from',
 1352+'diff-styleremoved' => '$1 style removed',
 1353+'diff-removed' => '$1 removed',
 1354+'diff-changedfrom' => 'changed from $1',
13551355 'diff-src' => 'source',
1356 -'diff-withdestination' => 'with destination',
 1356+'diff-withdestination' => 'with destination $1',
13571357 'diff-with' => ' with $1 $2',
13581358 'diff-with-additional' => '$1 $2', # only translate this message to other languages if you have to change it
13591359 'diff-with-final' => ' and $1 $2',

Status & tagging log