r49340 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49339‎ | r49340 | r49341 >
Date:12:58, 9 April 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Fixed language fallback. Removed unused $language parameter from getMessage().
Modified paths:
  • /trunk/extensions/SecurePoll/includes/Entity.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SecurePoll/includes/Entity.php
@@ -167,17 +167,13 @@
168168 * a placeholder string is returned.
169169 *
170170 * @param $name string
171 - * @param $language string Set this to false for the current language.
172171 */
173 - function getMessage( $name, $language = false ) {
174 - if ( $language === false ) {
175 - $language = reset( self::$languages );
176 - }
177 - if ( empty( $this->messagesLoaded[$language] ) ) {
178 - $this->loadMessages( $language );
179 - }
 172+ function getMessage( $name ) {
180173 $id = $this->getId();
181174 foreach ( self::$languages as $language ) {
 175+ if ( empty( $this->messagesLoaded[$language] ) ) {
 176+ $this->loadMessages( $language );
 177+ }
182178 if ( isset( self::$messageCache[$language][$id][$name] ) ) {
183179 return self::$messageCache[$language][$id][$name];
184180 }

Status & tagging log