r35998 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35997‎ | r35998 | r35999 >
Date:19:02, 7 June 2008
Author:siebrand
Status:old
Tags:
Comment:
* add support for CreateBox
* whitespace fixes
* if (!defined('MEDIAWIKI')) die(); where missing
* FlaggedRevs meta group
Modified paths:
  • /trunk/extensions/Translate/Message.php (modified) (history)
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/SpecialMagic.php (modified) (history)
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)
  • /trunk/extensions/Translate/TranslateTasks.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Gettext.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Wiki.php (modified) (history)
  • /trunk/extensions/Translate/ffs/WikiExtension.php (modified) (history)
  • /trunk/extensions/Translate/mwextensions/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/mwextensions/defines.txt (modified) (history)
  • /trunk/extensions/Translate/poimport.php (modified) (history)
  • /trunk/extensions/Translate/utils/MemProfile.php (modified) (history)
  • /trunk/extensions/Translate/utils/ResourceLoader.php (modified) (history)
  • /trunk/extensions/Translate/utils/StringMangler.php (modified) (history)
  • /trunk/extensions/Translate/utils/StringMatcher.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -188,6 +188,4 @@
189189 TranslateUtils::injectCSS();
190190 return Xml::tags( 'div', array( 'class' => 'mw-sp-translate-edit-fields' ), implode("\n\n", $boxes) );
191191 }
192 -
193 -
194192 }
Index: trunk/extensions/Translate/Translate.php
@@ -88,6 +88,7 @@
8989 'core-mostused' => 'CoreMostUsedMessageGroup',
9090 'ext-0-all' => 'AllMediawikiExtensionsGroup',
9191 'ext-0-wikimedia' => 'AllWikimediaExtensionsGroup',
 92+'ext-0-flaggedrevs' => 'AllFlaggedRevsExtensionsGroup',
9293 'out-freecol' => 'FreeColMessageGroup',
9394 'out-word2mediawikiplus' => 'Word2MediaWikiPlusMessageGroup',
9495 );
Index: trunk/extensions/Translate/TranslateTasks.php
@@ -325,7 +325,7 @@
326326 $writer = $this->messageGroup->getWriter();
327327 $writer->addAuthors( $this->getAuthorsArray(), $this->options->getLanguage() );
328328 $data = $writer->webExport( $this->messages );
329 -
 329+
330330 return Xml::openElement( 'textarea', array( 'id' => 'wpTextbox1', 'rows' => '50' ) ) .
331331 $data .
332332 "</textarea>";
Index: trunk/extensions/Translate/poimport.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34 /**
45 * Imports po files exported from Special:Translate back.
56 *
@@ -251,6 +252,5 @@
252253 } else {
253254 echo "Failed!\n";
254255 }
255 -
256256 }
257257 }
Index: trunk/extensions/Translate/utils/StringMatcher.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 class StringMatcher extends StringMangler {
56 protected $sPrefix = '';
@@ -106,5 +107,4 @@
107108
108109 return $temp;
109110 }
110 -
111 -}
\ No newline at end of file
 111+}
Index: trunk/extensions/Translate/utils/StringMangler.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 class StringMangler {
56 protected $manglers;
Index: trunk/extensions/Translate/utils/ResourceLoader.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 class ResourceLoader {
56
@@ -10,5 +11,4 @@
1112 return isset( $$_variable ) ? $$_variable : null;
1213 }
1314 }
14 -
1515 }
Index: trunk/extensions/Translate/utils/MemProfile.php
@@ -10,7 +10,6 @@
1111 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1212 */
1313
14 -
1514 $wgMemUse = array();
1615 $wgMemStack = 0;
1716 function wfMemIn( $a ) {
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -613,17 +613,17 @@
614614 'translate-magic-pagename' => 'Troidigezh Mediawiki astennet',
615615 'translate-magic-help' => "Gallout a rit treiñ aliasoù ar pajennoù dibar, ar gerioù burzhudus, anvioù an etrefasoù hag anvioù an esaouennoù anv.
616616
617 -Evit ar pezh a sell ouzh ar gerioù burzhudus e vo ret deoc'h ouzhpennañ an droidigezh saoznek pe ne'z aint ket en-dro ken.
 617+Evit ar pezh a sell ouzh ar gerioù burzhudus e vo ret deoc'h ouzhpennañ an droidigezh saoznek pe ne'z aint ket en-dro ken.
618618 Dalc'hit ivez an elfenn gentañ (0 pe 1) evel m'emañ.
619619
620 -Aliasoù ar pajennoù dibar hag ar gerioù burzhudus a c'hall kaout meur a droidigezh.
621 -Dispartiet eo an troidigezhioù dre skejoù (,).
 620+Aliasoù ar pajennoù dibar hag ar gerioù burzhudus a c'hall kaout meur a droidigezh.
 621+Dispartiet eo an troidigezhioù dre skejoù (,).
622622 N'hall anvioù an etrefasoù ha re an esaouennoù anv nemet kaout un droidigezh hepken.
623623
624 -E troidigezhioù an esaouennoù anv eo dibar <tt>$1 talk</tt>. Erlec'hiet eo <tt>$1</tt> gant anv al lec'hienn (da skouer <tt>{{SITENAME}} talk</tt>).
 624+E troidigezhioù an esaouennoù anv eo dibar <tt>$1 talk</tt>. Erlec'hiet eo <tt>$1</tt> gant anv al lec'hienn (da skouer <tt>{{SITENAME}} talk</tt>).
625625 Ma n'haller ket sevel lavarennoù reizh en ho yezh hep kemmañ anv al lec'hienn, kit e darempred gant un diorroer.
626626
627 -Ret eo deoc'h bezañ ezel eus ur strollad troerien evit enrollañ ar c'hemmoù.
 627+Ret eo deoc'h bezañ ezel eus ur strollad troerien evit enrollañ ar c'hemmoù.
628628 Ne vo ket enrollet ar c'hemmoù e-keit ha ne vo ket bet pouezet war ar bouton dindan.",
629629 'translate-magic-form' => 'Yezh $1 Modulenn : $2 $3',
630630 'translate-magic-submit' => 'Mont',
@@ -4275,7 +4275,7 @@
42764276 'translate-ignored' => '(нодида гирифташуда)',
42774277 'translate-edit-definition' => 'Таърифи пайғом',
42784278 'translate-edit-contribute' => 'ҳиссагузорӣ',
4279 - 'translate-edit-no-information' => "''Ин пайғом дорои тавзеҳот нест.
 4279+ 'translate-edit-no-information' => "''Ин пайғом дорои тавзеҳот нест.
42804280 Агар шумо медонед ин пағом чигуна ё дар куҷо истифода мешавад, шумо метавонед бо изофа кардани тавзеҳот ба ин пайғом ба дигар тарҷумакунандагон кӯмак кунед.''",
42814281 'translate-edit-information' => 'Иттилоот дар мавриди ин пайғом ($1)',
42824282 'translate-edit-in-other-languages' => 'Ҳамин пайғом дар дигар забонҳо',
@@ -4352,14 +4352,14 @@
43534353
43544354 ในตัวแปรพิเศษ กรุณาใส่คำแปลภาษาอังกฤษไปด้วยเช่นเดียวกัน มิฉะนั้นมันจะหยุดทำงาน กรุณาเว้นอันแรก (0 หรือ 1) อย่างที่มันเป็น
43554355
4356 -ชื่อหน้าพิเศษและตัวแปรพิเศษสามารถมีคำแปลได้หลายอย่าง
4357 -คำแปลจะแยกโดยการใช้ จุลภาค (,)
 4356+ชื่อหน้าพิเศษและตัวแปรพิเศษสามารถมีคำแปลได้หลายอย่าง
 4357+คำแปลจะแยกโดยการใช้ จุลภาค (,)
43584358 ชื่อแบบหน้าตาและเนมสเปซสามารถมีคำแปลได้แค่คำเดียว
43594359
4360 -ในคำแปลชื่อเนมสเปซ <tt>คุยเรื่อง$1</tt> ต้องระวังเป็นพิเศษ <tt>$1</tt> จะถูกแทนที่โดยชื่อเว็บไซต์ (เช่น <tt>คุยเรื่อง{{SITENAME}}</tt>)
 4360+ในคำแปลชื่อเนมสเปซ <tt>คุยเรื่อง$1</tt> ต้องระวังเป็นพิเศษ <tt>$1</tt> จะถูกแทนที่โดยชื่อเว็บไซต์ (เช่น <tt>คุยเรื่อง{{SITENAME}}</tt>)
43614361 ถ้าไม่สามารถกระทำการดังกล่าวได้ในภาษาของคุณ, กรุณาติดต่อผู้ดูแลระบบขั้นสูง
43624362
4363 -คุณต้องอยู่ในกลุ่มคนแปลเพื่อที่จะบันทึกข้อมูลได้
 4363+คุณต้องอยู่ในกลุ่มคนแปลเพื่อที่จะบันทึกข้อมูลได้
43644364 ข้อมูลจะไม่ถูกบันทึกตราบใดที่คุณยังไม่กด "บันทึก"',
43654365 'translate-magic-form' => 'ภาษา: $1 Module: $2 $3',
43664366 'translate-magic-submit' => 'ดึงข้อมูล',
@@ -4987,4 +4987,3 @@
49884988 'translate-checks-xhtml' => '請修正以下的標籤:<strong>$1</strong>',
49894989 'translate-checks-plural' => '原始訊息使用於<nowiki>{{PLURAL:}}</nowiki>中,並沒有用於翻譯。',
49904990 );
4991 -
Index: trunk/extensions/Translate/mwextensions/MediaWikiExtensions.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 class PremadeMediawikiExtensionGroups {
56 protected $groups;
@@ -52,8 +53,8 @@
5354 $groups[] = $newgroup;
5455 }
5556 }
56 -
5757
 58+
5859 foreach ( $groups as $g ) {
5960 if ( !is_array($g) ) {
6061 $g = array($g);
@@ -110,4 +111,4 @@
111112 return $group;
112113 }
113114
114 -}
\ No newline at end of file
 115+}
Index: trunk/extensions/Translate/mwextensions/defines.txt
@@ -136,6 +136,8 @@
137137
138138 Count Edits
139139
 140+Create Box
 141+
140142 Cross Namespace Links
141143 file = CrossNamespaceLinks/SpecialCrossNamespaceLinks.i18n.php
142144
Index: trunk/extensions/Translate/SpecialMagic.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 /**
56 * This special page helps with the translations of MediaWiki features that are
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1,4 +1,5 @@
22 <?php
 3+if (!defined('MEDIAWIKI')) die();
34
45 abstract class MessageGroup {
56 /**
@@ -444,6 +445,38 @@
445446 }
446447 }
447448
 449+class AllFlaggedRevsExtensionsGroup extends AllMediawikiExtensionsGroup {
 450+ protected $fileExporter = null;
 451+ protected $label = 'All FlaggedRevs messages';
 452+ protected $id = 'ext-0-flaggedrevs';
 453+ protected $meta = true;
 454+
 455+ protected $classes = null;
 456+
 457+ protected $flaggedrevsextensions = array(
 458+ 'ext-fr-flaggedrevs',
 459+ 'ext-fr-depreciationoversight',
 460+ 'ext-fr-flaggedrevsaliases',
 461+ 'ext-fr-oldreviewedpages',
 462+ 'ext-fr-qualityoversight',
 463+ 'ext-fr-reviewedpages',
 464+ 'ext-fr-stabilization',
 465+ 'ext-fr-stablepages',
 466+ 'ext-fr-stableversions',
 467+ 'ext-fr-unreviewedpages',
 468+ );
 469+
 470+ protected function init() {
 471+ if ( $this->classes === null ) {
 472+ $this->classes = array();
 473+ $classes = MessageGroups::singleton()->getGroups();
 474+ foreach ( $this->flaggedrevsextensions as $key ) {
 475+ $this->classes[$key] = $classes[$key];
 476+ }
 477+ }
 478+ }
 479+}
 480+
448481 class Word2MediaWikiPlusMessageGroup extends ExtensionMessageGroup {
449482 protected $label = 'Word2MediaWiki Plus';
450483 protected $id = 'out-word2mediawikiplus';
Index: trunk/extensions/Translate/Message.php
@@ -292,5 +292,4 @@
293293 return false;
294294 }
295295 }
296 -
297296 }
Index: trunk/extensions/Translate/ffs/WikiExtension.php
@@ -9,7 +9,6 @@
1010 * @file
1111 */
1212
13 -
1413 class WikiExtensionFormatReader extends WikiFormatReader {
1514 public function parseSections( $var ) {
1615 if ( $this->filename === false ) {
@@ -178,5 +177,4 @@
179178
180179 // Inherit
181180 #protected function writeMessagesBlock( $handle, $messages );
182 -
183181 }
Index: trunk/extensions/Translate/ffs/Wiki.php
@@ -15,7 +15,6 @@
1616 * @file
1717 */
1818
19 -
2019 class WikiFormatReader extends SimpleFormatReader {
2120 // Set by creater
2221 public $variableName = 'messages';
@@ -199,5 +198,4 @@
200199 fwrite( $handle, $quote . $value . $quote );
201200 fwrite( $handle, ",\n" );
202201 }
203 -
204202 }
Index: trunk/extensions/Translate/ffs/Gettext.php
@@ -1,9 +1,10 @@
22 <?php
3 -
 3+if (!defined('MEDIAWIKI')) die();
44 /**
55 * Parses a po file that has been exported from Mediawiki. Other files are not
66 * supported.
77 */
 8+
89 class GettextFormatHandler {
910
1011 public function __construct( $file ) {
@@ -185,8 +186,5 @@
186187 $messages = array();
187188 require( $filename );
188189 return $messages;
189 -
190190 }
191 -
192 -
193191 }

Status & tagging log