Index: trunk/extensions/CentralNotice/BannerLoader.php |
— | — | @@ -92,8 +92,13 @@ |
93 | 93 | return $out; |
94 | 94 | } |
95 | 95 | |
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]; |
98 | 103 | $message = "centralnotice-{$this->bannerName}-$field"; |
99 | 104 | $source = $this->getMessage( $message ); |
100 | 105 | return $source; |
— | — | @@ -111,6 +116,11 @@ |
112 | 117 | return $lang->formatNum( $num ); |
113 | 118 | } |
114 | 119 | |
| 120 | + /** |
| 121 | + * Retrieve a translated message |
| 122 | + * @param $msg The full name of the message |
| 123 | + * @return translated messsage string |
| 124 | + */ |
115 | 125 | private function getMessage( $msg ) { |
116 | 126 | global $wgLang; |
117 | 127 | |