r29575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29574‎ | r29575 | r29576 >
Date:07:25, 11 January 2008
Author:siebrand
Status:old
Tags:
Comment:
* use wfLoadExtensionMessages for Contributionseditcount
* Delay message loading
* add version and url in extension credits
* update Translate extension
Modified paths:
  • /trunk/extensions/Contributionseditcount/Contributionseditcount.i18n.php (modified) (history)
  • /trunk/extensions/Contributionseditcount/Contributionseditcount.php (modified) (history)
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contributionseditcount/Contributionseditcount.i18n.php
@@ -1,141 +1,135 @@
22 <?php
3 -
43 /**
5 - * Messages file for the Contributionseditcount extension
6 - */
7 -
8 -function efContributionseditcountMessages() {
9 - $messages = array(
10 -
11 -/* English */
12 -'en' => array(
 4+ * Internationalisation file for extension Contributionseditcount.
 5+ *
 6+ * @addtogroup Extensions
 7+*/
 8+
 9+$messages = array();
 10+
 11+$messages['en'] = array(
1312 'contributionseditcount' => 'This user has $1 edits.',
14 -),
 13+);
1514
16 -'ar' => array(
 15+$messages['ar'] = array(
1716 'contributionseditcount' => 'هذا المستخدم لديه $1 تعديل.',
18 -),
 17+);
1918
20 -'bcl' => array(
 19+$messages['bcl'] = array(
2120 'contributionseditcount' => 'An parágamit na ini igwang $1 na mga hirá.',
22 -),
 21+);
2322
24 -'bg' => array(
 23+$messages['bg'] = array(
2524 'contributionseditcount' => 'Този потребител е направил $1 редакции.',
26 -),
 25+);
2726
28 -'bn' => array(
 27+$messages['bn'] = array(
2928 'contributionseditcount' => 'এ ব্যবহারকারীর $1 সম্পাদনা হয়েছে।',
30 -),
 29+);
3130
32 -'de' => array(
 31+$messages['de'] = array(
3332 'contributionseditcount' => 'Dieser Benutzer hat $1 Bearbeitungen.',
34 -),
 33+);
3534
36 -'el' => array(
 35+$messages['el'] = array(
3736 'contributionseditcount' => 'Αυτός ο χρήστης έχει κάνει $1 επεξεργασίες.',
38 -),
 37+);
3938
40 -'ext' => array(
 39+$messages['ext'] = array(
4140 'contributionseditcount' => 'Esti usuáriu á hechu $1 eicionis.',
42 -),
 41+);
4342
44 -'fi' => array(
 43+$messages['fi'] = array(
4544 'contributionseditcount' => 'Tällä käyttäjällä on $1 muokkausta.',
46 -),
 45+);
4746
48 -'fr' => array(
 47+$messages['fr'] = array(
4948 'contributionseditcount' => 'Cet utilisateur a {{PLURAL:$1|$1 édition|$1 éditions}}.',
50 -),
 49+);
5150
52 -'gl' => array(
 51+$messages['gl'] = array(
5352 'contributionseditcount' => 'Este usuario ten $1 edicións.',
54 -),
 53+);
5554
56 -'hsb' => array(
 55+$messages['hsb'] = array(
5756 'contributionseditcount' => 'Wužiwar ma $1 změnow.',
58 -),
 57+);
5958
60 -'it' => array(
 59+$messages['it'] = array(
6160 'contributionseditcount' => 'Questo utente ha $1 edit',
62 -),
 61+);
6362
6463 /** Luxembourgish (Lëtzebuergesch)
6564 * @author Robby
6665 */
67 -'lb' => array(
 66+$messages['lb'] = array(
6867 'contributionseditcount' => 'Dëse Benotzer huet $1 Kontributiounen.',
69 -),
 68+);
7069
71 -'nl' => array(
 70+$messages['nl'] = array(
7271 'contributionseditcount' => 'Deze gebruiker heeft $1 bewerkingen.',
73 -),
 72+);
7473
75 -'no' => array(
 74+$messages['no'] = array(
7675 'contributionseditcount' => 'Denne brukeren har $1 redigeringer.',
77 -),
 76+);
7877
79 -'oc' => array(
 78+$messages['oc'] = array(
8079 'contributionseditcount' => 'Aqueste utilizaire a {{PLURAL:$1|$1 edicion|$1 edicions}}.',
81 -),
 80+);
8281
83 -'pl' => array(
 82+$messages['pl'] = array(
8483 'contributionseditcount' => 'Ten użytkownik ma $1 edycji.',
85 -),
 84+);
8685
87 -'pms' => array(
 86+$messages['pms'] = array(
8887 'contributionseditcount' => 'St\'utent-sì a l\'ha fait $1 modìfiche.',
89 -),
 88+);
9089
91 -'pt' => array(
 90+$messages['pt'] = array(
9291 'contributionseditcount' => 'Este utilizador tem $1 edições.',
93 -),
 92+);
9493
95 -'sah' => array(
 94+$messages['sah'] = array(
9695 'contributionseditcount' => 'Бу кыттааччы $1 көннөрүүлээх.',
97 -),
 96+);
9897
9998 /** Slovak (Slovenčina)
10099 * @author Helix84
101100 */
102 -'sk' => array(
 101+$messages['sk'] = array(
103102 'contributionseditcount' => 'Tento používateľ má $1 úprav.',
104 -),
 103+);
105104
106105 /** Seeltersk (Seeltersk)
107106 * @author Pyt
108107 */
109 -'stq' => array(
 108+$messages['stq'] = array(
110109 'contributionseditcount' => 'Dissen Benutser häd $1 Beoarbaidengen.',
111 -),
 110+);
112111
113112 /** Volapük (Volapük)
114113 * @author Malafaya
115114 */
116 -'vo' => array(
 115+$messages['vo'] = array(
117116 'contributionseditcount' => 'Geban at labon redakamis $1.',
118 -),
 117+);
119118
120 -'yue' => array(
 119+$messages['yue'] = array(
121120 'contributionseditcount' => '呢個用戶有 $1 次編輯。',
122 -),
 121+);
123122
124 -'zh-hans' => array(
 123+$messages['zh-hans'] = array(
125124 'contributionseditcount' => '这个用户拥有 $1 次编辑。',
126 -),
 125+);
127126
128 -'zh-hant' => array(
 127+$messages['zh-hant'] = array(
129128 'contributionseditcount' => '這個用戶擁有 $1 次編輯。',
130 -),
 129+);
131130
132 - );
133 -
134 - $messages['zh'] = $messages['zh-hans'];
135 - $messages['zh-cn'] = $messages['zh-hans'];
136 - $messages['zh-hk'] = $messages['zh-hant'];
137 - $messages['zh-sg'] = $messages['zh-hans'];
138 - $messages['zh-tw'] = $messages['zh-hant'];
139 - $messages['zh-yue'] = $messages['yue'];
140 -
141 - return $messages;
142 -}
 131+$messages['zh'] = $messages['zh-hans'];
 132+$messages['zh-cn'] = $messages['zh-hans'];
 133+$messages['zh-hk'] = $messages['zh-hant'];
 134+$messages['zh-sg'] = $messages['zh-hans'];
 135+$messages['zh-tw'] = $messages['zh-hant'];
 136+$messages['zh-yue'] = $messages['yue'];
Index: trunk/extensions/Contributionseditcount/Contributionseditcount.php
@@ -15,10 +15,14 @@
1616 $wgExtensionFunctions[] = 'wfContributionseditcount';
1717 $wgExtensionCredits['other'][] = array(
1818 'name' => 'Contributionseditcount',
19 - 'description' => 'displays an edit count on Special:Contributions',
20 - 'author' => 'Ævar Arnfjörð Bjarmason'
 19+ 'version' => '2008-01-11',
 20+ 'description' => 'Displays an edit count on Special:Contributions',
 21+ 'author' => 'Ævar Arnfjörð Bjarmason',
 22+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Contributionseditcount',
2123 );
2224
 25+$wgExtensionMessagesFiles['Contributionseditcount'] = dirname( __FILE__ ) . '/Contributionseditcount.i18n.php';
 26+
2327 function wfContributionseditcount() {
2428
2529 wfUsePHP( 5.0 );
@@ -27,21 +31,18 @@
2832 class Contributionseditcount {
2933
3034 public function __construct() {
31 - global $wgMessageCache, $wgHooks;
32 - require_once( dirname( __FILE__ ) . '/Contributionseditcount.i18n.php' );
33 - foreach( efContributionseditcountMessages() as $lang => $messages )
34 - $wgMessageCache->addMessages( $messages, $lang );
 35+ global $wgHooks;
3536 $wgHooks['SpecialContributionsBeforeMainOutput'][] = array( &$this, 'hook' );
3637 }
37 -
 38+
3839 public function hook( $uid ) {
3940 global $wgOut, $wgLang;
4041 if ( $uid != 0 )
 42+ wfLoadExtensionMessages( 'Contributionseditcount' );
4143 $wgOut->addWikiText( wfMsg( 'contributionseditcount', $wgLang->formatNum( User::edits( $uid ) ) ) );
4244 return true;
4345 }
4446 }
4547
4648 new Contributionseditcount();
47 -
48 -}
\ No newline at end of file
 49+}
Index: trunk/extensions/Translate/MessageGroups.php
@@ -951,15 +951,11 @@
952952 }
953953
954954 class ContributionseditcountMessageGroup extends ExtensionMessageGroup {
955 - protected $fileExporter = null;
956955 protected $label = 'Contributions Edit Count';
957956 protected $id = 'ext-contributionseditcount';
958957
959 - protected $functionName = 'efContributionseditcountMessages';
 958+ protected $arrName = 'messages';
960959 protected $messageFile = 'Contributionseditcount/Contributionseditcount.i18n.php';
961 -
962 - protected $exportStart = '\'$CODE\' => array(';
963 - protected $exportEnd = '),';
964960 }
965961
966962 class ContributorsMessageGroup extends ExtensionMessageGroup {

Follow-up revisions

RevisionCommit summaryAuthorDate
r51732Fix syntax error introduced in r51712...purodha07:03, 11 June 2009

Status & tagging log