r25595 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25594‎ | r25595 | r25596 >
Date:17:43, 6 September 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Bugfixes to message groups and tasks
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateTasks.php (modified) (history)
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -12,7 +12,7 @@
1313
1414 $wgExtensionCredits['specialpage'][] = array(
1515 'name' => 'Translate',
16 - 'version' => '4.0-rc3',
 16+ 'version' => '4.0-rc4',
1717 'author' => 'Niklas Laxström',
1818 'description' => 'Special page for translating Mediawiki and beyond'
1919 );
Index: trunk/extensions/Translate/TranslateUtils.php
@@ -6,12 +6,7 @@
77 const MSG = "translate-";
88
99 public static function databaseLanguageSuffix( $language ) {
10 - global $wgContLang;
11 - if ( $wgContLang->getCode() !== $language ) {
12 - return '/' . $language;
13 - } else {
14 - return '';
15 - }
 10+ return '/' . $language;
1611 }
1712
1813 public static function title( $key, $language ) {
@@ -46,7 +41,6 @@
4742 $messages[$key]['optional'] = false;
4843 $messages[$key]['ignored'] = false;
4944 $messages[$key]['changed'] = false;
50 - $messages[$key]['defined'] = false;
5145 $messages[$key]['pageexists'] = false;
5246 $messages[$key]['talkexists'] = false;
5347 }
@@ -180,7 +174,7 @@
181175 return $tableheader;
182176 }
183177
184 - public static function makeListing( $messages, $language ) {
 178+ public static function makeListing( $messages, $language, $group ) {
185179 global $wgUser;
186180 $sk = $wgUser->getSkin();
187181 wfLoadExtensionMessages( 'Translate' );
@@ -218,8 +212,6 @@
219213
220214 $page['edit'] = $uimsg['edit'];
221215 if ( $wgUser->isAllowed( 'translate' ) ) {
222 - // UGLY HACK
223 - $group = $GLOBALS['wgRequest']->getText('group', '');
224216 $page['edit'] = $sk->makeKnownLinkObj( $page['object'], $uimsg['edit'], "action=edit&loadgroup=$group" );
225217 }
226218 $page['history'] = $sk->makeKnownLinkObj( $page['object'], $uimsg['history'], 'action=history' );
Index: trunk/extensions/Translate/TranslateTasks.php
@@ -132,7 +132,7 @@
133133
134134 return
135135 $tableheader .
136 - TranslateUtils::makeListing( $this->messages, $this->options->getLanguage() ) .
 136+ TranslateUtils::makeListing( $this->messages, $this->options->getLanguage(), $this->messageGroup->getId() ) .
137137 $tablefooter;
138138 }
139139
@@ -212,7 +212,7 @@
213213 protected function filterUnchanged() {
214214 foreach ( $this->messages as $key => $o ) {
215215 $translation = $o['database'] ? $o['database'] : $o['infile'];
216 - if ( $o['pageexists'] && $translation != $o['definition'] ) {
 216+ if ( $o['pageexists'] || ( $translation !== null && $translation != $o['definition'] ) ) {
217217 $this->messages[$key]['changed'] = true;
218218 } else {
219219 unset( $this->messages[$key] );
Index: trunk/extensions/Translate/MessageGroups.php
@@ -56,7 +56,7 @@
5757 }
5858 }
5959 if ( $translation === $fallback ) {
60 - if ( $m['defined'] ) {
 60+ if ( $m['pageexists'] ) {
6161 $comment = "#identical but defined";
6262 return true;
6363 } else {
@@ -231,6 +231,7 @@
232232 $this->exportStart ) . "\n";
233233
234234 foreach ($this->msgArray['en'] as $key => $msg) {
 235+ if ( !isset( $array[$key] ) ) { continue; }
235236 $line = $this->exportLine($key, $array[$key], $this->exportPad);
236237 if ( $line !== null ) {
237238 $txt .= $this->exportLineP . $line;
@@ -485,7 +486,7 @@
486487 protected $messageFile = 'CategoryTree/CategoryTree.i18n.php';
487488 protected $filePattern = 'CategoryTree/CategoryTree.i18n.$CODE.php';
488489
489 - protected $exportStart = '$messages[\'$CODE\'] = array(';
 490+ protected $exportStart = '$messages = array(';
490491 protected $exportEnd = '),';
491492
492493 }
@@ -552,7 +553,7 @@
553554 protected $messageFile = 'ContactPage/ContactPage.i18n.php';
554555 protected $filePattern = 'ContactPage/ContactPage.i18n.$CODE.php';
555556
556 - protected $exportStart = '$messages[\'$CODE\'] = array(';
 557+ protected $exportStart = '$messages = array(';
557558 protected $exportLineP = '';
558559 protected $exportEnd = '),';
559560
@@ -681,7 +682,7 @@
682683 protected $arrName = 'RevisionreviewMessages';
683684 protected $messageFile = 'FlaggedRevs/FlaggedRevsPage.i18n.php';
684685
685 - protected $exportStart = '$RevisionreviewMessage[\'$CODE\'] = array(';
 686+ protected $exportStart = '$RevisionreviewMessages[\'$CODE\'] = array(';
686687 protected $exportPrefix= '';
687688 protected $exportLineP = "\t";
688689 protected $exportEnd = ');';

Status & tagging log