r15515 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r15514‎ | r15515 | r15516 >
Date:20:22, 10 July 2006
Author:hashar
Status:old
Tags:
Comment:
make methods compatible with parent class 'Language'
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/LanguageAr.php (modified) (history)
  • /trunk/phase3/languages/LanguageBg.php (modified) (history)
  • /trunk/phase3/languages/LanguageBr.php (modified) (history)
  • /trunk/phase3/languages/LanguageCy.php (modified) (history)
  • /trunk/phase3/languages/LanguageDa.php (modified) (history)
  • /trunk/phase3/languages/LanguageHu.php (modified) (history)
  • /trunk/phase3/languages/LanguageIs.php (modified) (history)
  • /trunk/phase3/languages/LanguageKo.php (modified) (history)
  • /trunk/phase3/languages/LanguageNn.php (modified) (history)
  • /trunk/phase3/languages/LanguagePt.php (modified) (history)
  • /trunk/phase3/languages/LanguageRu.php (modified) (history)
  • /trunk/phase3/languages/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/LanguageSr_ec.php (modified) (history)
  • /trunk/phase3/languages/LanguageSr_el.php (modified) (history)
  • /trunk/phase3/languages/LanguageTt.php (modified) (history)
  • /trunk/phase3/languages/LanguageZh_cn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguagePt.php
@@ -194,7 +194,7 @@
195195 * Exports $wgMagicWordsPt
196196 * @return array
197197 */
198 - function getMagicWords() {
 198+ function &getMagicWords() {
199199 global $wgMagicWordsPt;
200200 return $wgMagicWordsPt;
201201 }
Index: trunk/phase3/languages/LanguageIs.php
@@ -103,7 +103,10 @@
104104 return $this->mMessagesIs;
105105 }
106106
107 - function date( $ts, $adj = false, $format = true) {
 107+ /**
 108+ * $timecorrection is for compatibility with Language::date
 109+ */
 110+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
108111 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
109112 $format = $this->dateFormat($format);
110113
@@ -123,7 +126,10 @@
124127
125128 }
126129
127 - function time($ts, $adj = false, $format = true) {
 130+ /**
 131+ * $timecorrection is for compatibility with language::time
 132+ */
 133+ function time($ts, $adj = false, $format = true, $timecorrection = false) {
128134 global $wgUser;
129135 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
130136
@@ -137,7 +143,10 @@
138144
139145 }
140146
141 - function timeanddate( $ts, $adj = false, $format = true) {
 147+ /**
 148+ * $timecorrection is for compatibility with Language::date
 149+ */
 150+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
142151 global $wgUser;
143152
144153 $format = $this->dateFormat($format);
Index: trunk/phase3/languages/LanguageBr.php
@@ -94,8 +94,10 @@
9595 return $wgSkinNamesBr;
9696 }
9797
98 -
99 - function date( $ts, $adj = false ) {
 98+ /**
 99+ * $format and $timecorrection are for compatibility with Language::date
 100+ */
 101+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
100102 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
101103
102104 $d = (0 + substr( $ts, 6, 2 )) . " " .
@@ -104,7 +106,10 @@
105107 return $d;
106108 }
107109
108 - function timeanddate( $ts, $adj = false ) {
 110+ /**
 111+ * $format and $timecorrection are for compatibility with Language::date
 112+ */
 113+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
109114 return $this->date( $ts, $adj ) . " da " . $this->time( $ts, $adj );
110115 }
111116
Index: trunk/phase3/languages/Language.php
@@ -1048,8 +1048,8 @@
10491049 * @param string $wordform3 (optional)
10501050 * @return string
10511051 */
1052 - function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
1053 - return $count == '1' ? $wordform1 : $wordform2;
 1052+ function convertPlural( $count, $w1, $w2, $w3) {
 1053+ return $count == '1' ? $w1 : $w2;
10541054 }
10551055
10561056 /**
Index: trunk/phase3/languages/LanguageSr_ec.php
@@ -157,7 +157,7 @@
158158 * Exports $wgMagicWordsSr_ec
159159 * @return array
160160 */
161 - function getMagicWords() {
 161+ function &getMagicWords() {
162162 global $wgMagicWordsSr_ec;
163163 return $wgMagicWordsSr_ec;
164164 }
Index: trunk/phase3/languages/LanguageKo.php
@@ -101,7 +101,10 @@
102102 return $this->mMessagesKo;
103103 }
104104
105 - function date( $ts, $adj = false ) {
 105+ /**
 106+ * $format and $timecorrection are for compatibility with Language::date
 107+ */
 108+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
106109 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
107110
108111 $year = (int)substr( $ts, 0, 4 );
Index: trunk/phase3/languages/LanguageCy.php
@@ -127,7 +127,7 @@
128128 return $wgAllMessagesCy;
129129 }
130130
131 - function getMagicWords() {
 131+ function &getMagicWords() {
132132 global $wgMagicWordsCy, $wgMagicWordsEn;
133133 return $wgMagicWordsCy + $wgMagicWordsEn;
134134 }
Index: trunk/phase3/languages/LanguageHu.php
@@ -109,8 +109,10 @@
110110 return "iso8859-2";
111111 }
112112
113 - # localised date and time
114 - function date( $ts, $adj = false ) {
 113+ /**
 114+ * $format and $timecorrection are for compatibility with Language::date
 115+ */
 116+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
115117 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
116118
117119 $d = substr( $ts, 0, 4 ) . ". " .
@@ -119,7 +121,10 @@
120122 return $d;
121123 }
122124
123 - function timeanddate( $ts, $adj = false ) {
 125+ /**
 126+ * $format and $timecorrection are for compatibility with Language::date
 127+ */
 128+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
124129 return $this->date( $ts, $adj ) . ", " . $this->time( $ts, $adj );
125130 }
126131
Index: trunk/phase3/languages/LanguageTt.php
@@ -90,8 +90,10 @@
9191 return $wgDateFormatsTt;
9292 }
9393
94 -
95 - function date( $ts, $adj = false ) {
 94+ /**
 95+ * $format and $timecorrection are for compatibility with Language::date
 96+ */
 97+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
9698 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
9799
98100 $d = (0 + substr( $ts, 6, 2 )) . ". " .
@@ -100,14 +102,20 @@
101103 return $d;
102104 }
103105
104 - function time( $ts, $adj = false ) {
 106+ /**
 107+ * $format and $timecorrection are for compatibility with language::time
 108+ */
 109+ function time($ts, $adj = false, $format = true, $timecorrection = false) {
105110 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
106111
107112 $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
108113 return $t;
109114 }
110115
111 - function timeanddate( $ts, $adj = false ) {
 116+ /**
 117+ * $format and $timecorrection are for compatibility with Language::date
 118+ */
 119+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
112120 return $this->date( $ts, $adj ) . ", " . $this->time( $ts, $adj );
113121 }
114122
Index: trunk/phase3/languages/LanguageAr.php
@@ -147,7 +147,7 @@
148148 return 'windows-1256';
149149 }
150150
151 - function getMagicWords() {
 151+ function &getMagicWords() {
152152 global $wgMagicWordsAr;
153153 return $wgMagicWordsAr;
154154 }
Index: trunk/phase3/languages/LanguageBg.php
@@ -167,7 +167,7 @@
168168 * Exports $wgMagicWordsBg
169169 * @return array
170170 */
171 - function getMagicWords() {
 171+ function &getMagicWords() {
172172 global $wgMagicWordsBg;
173173 return $wgMagicWordsBg;
174174 }
Index: trunk/phase3/languages/LanguageNn.php
@@ -171,7 +171,10 @@
172172 }
173173
174174
175 - function time($ts, $adj = false, $format = true) {
 175+ /**
 176+ * $timecorrection is for compatibility with language::time
 177+ */
 178+ function time($ts, $adj = false, $format = true, $timecorrection = false) {
176179 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
177180
178181 $format = $this->dateFormat($format);
@@ -184,7 +187,10 @@
185188
186189 }
187190
188 - function date( $ts, $adj = false, $format = true) {
 191+ /**
 192+ * $timecorrection is for compatibility with Language::date
 193+ */
 194+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
189195 global $wgUser;
190196 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
191197 $format = $this->dateFormat($format);
@@ -205,7 +211,10 @@
206212
207213 }
208214
209 - function timeanddate( $ts, $adj = false, $format = true) {
 215+ /**
 216+ * $format and $timecorrection are for compatibility with Language::date
 217+ */
 218+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
210219 global $wgUser;
211220
212221 $format = $this->dateFormat($format);
Index: trunk/phase3/languages/LanguageRu.php
@@ -154,7 +154,7 @@
155155 //only for quotation mark
156156 function linkPrefixExtension() { return true; }
157157
158 - function getMagicWords() {
 158+ function &getMagicWords() {
159159 global $wgMagicWordsRu;
160160 return $wgMagicWordsRu;
161161 }
Index: trunk/phase3/languages/LanguageZh_cn.php
@@ -95,7 +95,10 @@
9696 return false;
9797 }
9898
99 - function date( $ts, $adj = false ) {
 99+ /**
 100+ * $format and $timecorrection are for compatibility with Language::date
 101+ */
 102+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
100103 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
101104
102105 $d = substr( $ts, 0, 4 ) . "年" .
@@ -104,7 +107,10 @@
105108 return $d;
106109 }
107110
108 - function timeanddate( $ts, $adj = false ) {
 111+ /**
 112+ * $format and $timecorrection are for compatibility with Language::date
 113+ */
 114+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
109115 return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj );
110116 }
111117
Index: trunk/phase3/languages/LanguageSr_el.php
@@ -157,7 +157,7 @@
158158 * Exports $wgMagicWordsSr_el
159159 * @return array
160160 */
161 - function getMagicWords() {
 161+ function &getMagicWords() {
162162 global $wgMagicWordsSr_el;
163163 return $wgMagicWordsSr_el;
164164 }
Index: trunk/phase3/languages/LanguageSr.php
@@ -66,7 +66,7 @@
6767 /* rules should be defined as -{ekavian | iyekavian-} -or-
6868 -{code:text | code:text | ...}-
6969 */
70 - function parseManualRule($rule, $flags) {
 70+ function parseManualRule($rule, $flags=array()) {
7171
7272 $echoices = preg_split("/(<[^>]+>)/",$rule,-1,PREG_SPLIT_DELIM_CAPTURE);
7373 $choices = array();
Index: trunk/phase3/languages/LanguageDa.php
@@ -80,7 +80,10 @@
8181 return $wgDateFormatsDa;
8282 }
8383
84 - function date( $ts, $adj = false ) {
 84+ /**
 85+ * $format and $timecorrection are for compatibility with Language::date
 86+ */
 87+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
8588 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
8689
8790 $d = (0 + substr( $ts, 6, 2 )) . ". " .
@@ -89,7 +92,10 @@
9093 return $d;
9194 }
9295
93 - function timeanddate( $ts, $adj = false ) {
 96+ /**
 97+ * $format and $timecorrection are for compatibility with Language::date
 98+ */
 99+ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
94100 return $this->date( $ts, $adj ) . " kl. " . $this->time( $ts, $adj );
95101 }
96102