r72344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72343‎ | r72344 | r72345 >
Date:01:39, 4 September 2010
Author:kaldari
Status:ok
Tags:
Comment:
fixing bad parameter name, adding function documentation
Modified paths:
  • /trunk/extensions/CentralNotice/BannerLoader.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/BannerLoader.php
@@ -92,8 +92,13 @@
9393 return $out;
9494 }
9595
96 - function getNoticeField( $matches ) {
97 - $field = $matches[1];
 96+ /**
 97+ * Extract a message name and send to getMessage() for translation
 98+ * @param $match A message array with 2 members: raw match, short name of message
 99+ * @return translated messsage string
 100+ */
 101+ function getNoticeField( $match ) {
 102+ $field = $match[1];
98103 $message = "centralnotice-{$this->bannerName}-$field";
99104 $source = $this->getMessage( $message );
100105 return $source;
@@ -111,6 +116,11 @@
112117 return $lang->formatNum( $num );
113118 }
114119
 120+ /**
 121+ * Retrieve a translated message
 122+ * @param $msg The full name of the message
 123+ * @return translated messsage string
 124+ */
115125 private function getMessage( $msg ) {
116126 global $wgLang;
117127

Status & tagging log