r99809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99808‎ | r99809 | r99810 >
Date:21:19, 14 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Update documentation, returns
Modified paths:
  • /trunk/phase3/languages/classes/LanguageHu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageKk_cyrl.php (modified) (history)
  • /trunk/phase3/maintenance/language/checkLanguage.inc (modified) (history)
  • /trunk/phase3/maintenance/language/languages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/checkLanguage.inc
@@ -304,17 +304,17 @@
305305
306306 /**
307307 * Check a language.
308 - * @param $code The language code.
309 - * @return The results.
 308+ * @param $code string The language code.
 309+ * @return array The results.
310310 */
311311 protected function checkLanguage( $code ) {
312312 # Syntax check only
 313+ $results = array();
313314 if ( $this->level === 0 ) {
314315 $this->L->getMessages( $code );
315 - return;
 316+ return $results;
316317 }
317318
318 - $results = array();
319319 $checkFunctions = $this->getChecks();
320320 $checkBlacklist = $this->getCheckBlacklist();
321321 foreach ( $this->checks as $check ) {
@@ -643,7 +643,7 @@
644644
645645 /**
646646 * Check a language and show the results.
647 - * @param $code The language code.
 647+ * @param $code string The language code.
648648 */
649649 protected function checkLanguage( $code ) {
650650 foreach( $this->extensions as $extension ) {
Index: trunk/phase3/maintenance/language/languages.inc
@@ -61,7 +61,7 @@
6262 /**
6363 * Get the language list.
6464 *
65 - * @return The language list.
 65+ * @return array The language list.
6666 */
6767 public function getLanguages() {
6868 return $this->mLanguages;
@@ -70,7 +70,7 @@
7171 /**
7272 * Get the ignored messages list.
7373 *
74 - * @return The ignored messages list.
 74+ * @return array The ignored messages list.
7575 */
7676 public function getIgnoredMessages() {
7777 return $this->mIgnoredMessages;
@@ -79,7 +79,7 @@
8080 /**
8181 * Get the optional messages list.
8282 *
83 - * @return The optional messages list.
 83+ * @return array The optional messages list.
8484 */
8585 public function getOptionalMessages() {
8686 return $this->mOptionalMessages;
@@ -137,7 +137,7 @@
138138 * obsolete - messages which should not be translated, either because they do not exist, or they are ignored messages.
139139 * translated - messages which are either required or optional, but translated from English and needed.
140140 *
141 - * @param $code The language code.
 141+ * @param $code string The language code.
142142 */
143143 private function loadMessages( $code ) {
144144 if ( isset( $this->mMessages[$code] ) ) {
@@ -203,7 +203,7 @@
204204 * obsolete - messages which should not be translated, either because they do not exist, or they are ignored messages.
205205 * translated - messages which are either required or optional, but translated from English and needed.
206206 *
207 - * @param $code The language code.
 207+ * @param $code string The language code.
208208 *
209209 * @return string The messages in this language.
210210 */
@@ -220,7 +220,7 @@
221221 * ignored - messages which should not be translated to other languages.
222222 * translatable - messages which are either required or optional, but can be translated from English.
223223 *
224 - * @return The general English messages.
 224+ * @return array The general English messages.
225225 */
226226 public function getGeneralMessages() {
227227 $this->loadGeneralMessages();
@@ -230,9 +230,9 @@
231231 /**
232232 * Get fallback language code for a specific language.
233233 *
234 - * @param $code The language code.
 234+ * @param $code string The language code.
235235 *
236 - * @return Fallback code.
 236+ * @return string Fallback code.
237237 */
238238 public function getFallback( $code ) {
239239 $this->loadFile( $code );
@@ -242,7 +242,7 @@
243243 /**
244244 * Get namespace names for a specific language.
245245 *
246 - * @param $code The language code.
 246+ * @param $code string The language code.
247247 *
248248 * @return Namespace names.
249249 */
@@ -254,7 +254,7 @@
255255 /**
256256 * Get namespace aliases for a specific language.
257257 *
258 - * @param $code The language code.
 258+ * @param $code string The language code.
259259 *
260260 * @return Namespace aliases.
261261 */
@@ -266,7 +266,7 @@
267267 /**
268268 * Get magic words for a specific language.
269269 *
270 - * @param $code The language code.
 270+ * @param $code string The language code.
271271 *
272272 * @return Magic words.
273273 */
@@ -278,7 +278,7 @@
279279 /**
280280 * Get special page aliases for a specific language.
281281 *
282 - * @param $code The language code.
 282+ * @param $code string The language code.
283283 *
284284 * @return Special page aliases.
285285 */
@@ -290,9 +290,9 @@
291291 /**
292292 * Get the untranslated messages for a specific language.
293293 *
294 - * @param $code The language code.
 294+ * @param $code string The language code.
295295 *
296 - * @return The untranslated messages for this language.
 296+ * @return array The untranslated messages for this language.
297297 */
298298 public function getUntranslatedMessages( $code ) {
299299 $this->loadGeneralMessages();
@@ -303,9 +303,9 @@
304304 /**
305305 * Get the duplicate messages for a specific language.
306306 *
307 - * @param $code The language code.
 307+ * @param $code string The language code.
308308 *
309 - * @return The duplicate messages for this language.
 309+ * @return array The duplicate messages for this language.
310310 */
311311 public function getDuplicateMessages( $code ) {
312312 $this->loadGeneralMessages();
@@ -322,9 +322,9 @@
323323 /**
324324 * Get the obsolete messages for a specific language.
325325 *
326 - * @param $code The language code.
 326+ * @param $code string The language code.
327327 *
328 - * @return The obsolete messages for this language.
 328+ * @return array The obsolete messages for this language.
329329 */
330330 public function getObsoleteMessages( $code ) {
331331 $this->loadGeneralMessages();
@@ -335,9 +335,9 @@
336336 /**
337337 * Get the messages whose variables do not match the original ones.
338338 *
339 - * @param $code The language code.
 339+ * @param $code string The language code.
340340 *
341 - * @return The messages whose variables do not match the original ones.
 341+ * @return array The messages whose variables do not match the original ones.
342342 */
343343 public function getMessagesWithMismatchVariables( $code ) {
344344 $this->loadGeneralMessages();
@@ -366,9 +366,9 @@
367367 /**
368368 * Get the messages which do not use plural.
369369 *
370 - * @param $code The language code.
 370+ * @param $code string The language code.
371371 *
372 - * @return The messages which do not use plural in this language.
 372+ * @return array The messages which do not use plural in this language.
373373 */
374374 public function getMessagesWithoutPlural( $code ) {
375375 $this->loadGeneralMessages();
@@ -385,9 +385,9 @@
386386 /**
387387 * Get the empty messages.
388388 *
389 - * @param $code The language code.
 389+ * @param $code string The language code.
390390 *
391 - * @return The empty messages for this language.
 391+ * @return array The empty messages for this language.
392392 */
393393 public function getEmptyMessages( $code ) {
394394 $this->loadGeneralMessages();
@@ -404,9 +404,9 @@
405405 /**
406406 * Get the messages with trailing whitespace.
407407 *
408 - * @param $code The language code.
 408+ * @param $code string The language code.
409409 *
410 - * @return The messages with trailing whitespace in this language.
 410+ * @return array The messages with trailing whitespace in this language.
411411 */
412412 public function getMessagesWithWhitespace( $code ) {
413413 $this->loadGeneralMessages();
@@ -423,9 +423,9 @@
424424 /**
425425 * Get the non-XHTML messages.
426426 *
427 - * @param $code The language code.
 427+ * @param $code string The language code.
428428 *
429 - * @return The non-XHTML messages for this language.
 429+ * @return array The non-XHTML messages for this language.
430430 */
431431 public function getNonXHTMLMessages( $code ) {
432432 $this->loadGeneralMessages();
@@ -451,9 +451,9 @@
452452 /**
453453 * Get the messages which include wrong characters.
454454 *
455 - * @param $code The language code.
 455+ * @param $code string The language code.
456456 *
457 - * @return The messages which include wrong characters in this language.
 457+ * @return array The messages which include wrong characters in this language.
458458 */
459459 public function getMessagesWithWrongChars( $code ) {
460460 $this->loadGeneralMessages();
@@ -488,9 +488,9 @@
489489 /**
490490 * Get the messages which include dubious links.
491491 *
492 - * @param $code The language code.
 492+ * @param $code string The language code.
493493 *
494 - * @return The messages which include dubious links in this language.
 494+ * @return array The messages which include dubious links in this language.
495495 */
496496 public function getMessagesWithDubiousLinks( $code ) {
497497 $this->loadGeneralMessages();
@@ -517,9 +517,9 @@
518518 /**
519519 * Get the messages which include unbalanced brackets.
520520 *
521 - * @param $code The language code.
 521+ * @param $code string The language code.
522522 *
523 - * @return The messages which include unbalanced brackets in this language.
 523+ * @return array The messages which include unbalanced brackets in this language.
524524 */
525525 public function getMessagesWithUnbalanced( $code ) {
526526 $this->loadGeneralMessages();
@@ -547,7 +547,7 @@
548548 if ( $a !== $b || $c !== $d ) {
549549 $messages[$key] = "$a, $b, $c, $d";
550550 }
551 -
 551+
552552 }
553553 return $messages;
554554 }
@@ -555,9 +555,9 @@
556556 /**
557557 * Get the untranslated namespace names.
558558 *
559 - * @param $code The language code.
 559+ * @param $code string The language code.
560560 *
561 - * @return The untranslated namespace names in this language.
 561+ * @return array The untranslated namespace names in this language.
562562 */
563563 public function getUntranslatedNamespaces( $code ) {
564564 $this->loadFile( 'en' );
@@ -570,9 +570,9 @@
571571 /**
572572 * Get the project talk namespace names with no $1.
573573 *
574 - * @param $code The language code.
 574+ * @param $code string The language code.
575575 *
576 - * @return The problematic project talk namespaces in this language.
 576+ * @return array The problematic project talk namespaces in this language.
577577 */
578578 public function getProblematicProjectTalks( $code ) {
579579 $this->loadFile( $code );
@@ -599,9 +599,9 @@
600600 /**
601601 * Get the untranslated magic words.
602602 *
603 - * @param $code The language code.
 603+ * @param $code string The language code.
604604 *
605 - * @return The untranslated magic words in this language.
 605+ * @return array The untranslated magic words in this language.
606606 */
607607 public function getUntranslatedMagicWords( $code ) {
608608 $this->loadFile( 'en' );
@@ -618,9 +618,9 @@
619619 /**
620620 * Get the obsolete magic words.
621621 *
622 - * @param $code The language code.
 622+ * @param $code string The language code.
623623 *
624 - * @return The obsolete magic words in this language.
 624+ * @return array The obsolete magic words in this language.
625625 */
626626 public function getObsoleteMagicWords( $code ) {
627627 $this->loadFile( 'en' );
@@ -637,9 +637,9 @@
638638 /**
639639 * Get the magic words that override the original English magic word.
640640 *
641 - * @param $code The language code.
 641+ * @param $code string The language code.
642642 *
643 - * @return The overriding magic words in this language.
 643+ * @return array The overriding magic words in this language.
644644 */
645645 public function getOverridingMagicWords( $code ) {
646646 $this->loadFile( 'en' );
@@ -666,9 +666,9 @@
667667 /**
668668 * Get the magic words which do not match the case-sensitivity of the original words.
669669 *
670 - * @param $code The language code.
 670+ * @param $code string The language code.
671671 *
672 - * @return The magic words whose case does not match in this language.
 672+ * @return array The magic words whose case does not match in this language.
673673 */
674674 public function getCaseMismatchMagicWords( $code ) {
675675 $this->loadFile( 'en' );
@@ -689,9 +689,9 @@
690690 /**
691691 * Get the untranslated special page names.
692692 *
693 - * @param $code The language code.
 693+ * @param $code string The language code.
694694 *
695 - * @return The untranslated special page names in this language.
 695+ * @return array The untranslated special page names in this language.
696696 */
697697 public function getUntraslatedSpecialPages( $code ) {
698698 $this->loadFile( 'en' );
@@ -708,9 +708,9 @@
709709 /**
710710 * Get the obsolete special page names.
711711 *
712 - * @param $code The language code.
 712+ * @param $code string The language code.
713713 *
714 - * @return The obsolete special page names in this language.
 714+ * @return array The obsolete special page names in this language.
715715 */
716716 public function getObsoleteSpecialPages( $code ) {
717717 $this->loadFile( 'en' );
@@ -726,9 +726,13 @@
727727 }
728728
729729 class extensionLanguages extends languages {
730 - private $mMessageGroup; # The message group
731730
732731 /**
 732+ * @var MessageGroup
 733+ */
 734+ private $mMessageGroup;
 735+
 736+ /**
733737 * Load the messages group.
734738 * @param $group The messages group.
735739 */
@@ -743,7 +747,7 @@
744748 /**
745749 * Get the extension name.
746750 *
747 - * @return The extension name.
 751+ * @return string The extension name.
748752 */
749753 public function name() {
750754 return $this->mMessageGroup->getLabel();
@@ -752,7 +756,7 @@
753757 /**
754758 * Load the language file.
755759 *
756 - * @param $code The language code.
 760+ * @param $code string The language code.
757761 */
758762 protected function loadFile( $code ) {
759763 if( !isset( $this->mRawMessages[$code] ) ) {
Index: trunk/phase3/languages/classes/LanguageHu.php
@@ -25,5 +25,6 @@
2626 case 'k':
2727 return $word . 'k';
2828 }
 29+ return '';
2930 }
3031 }
Index: trunk/phase3/languages/classes/LanguageKk_cyrl.php
@@ -12,7 +12,7 @@
1313 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
1414 *
1515 * @param $word string
16 - * @param $case stirng
 16+ * @param $case string
1717 *
1818 * @return string
1919 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r102466Readd Names.php and other files removed in r102465...platonides23:35, 8 November 2011

Status & tagging log