r41438 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41437‎ | r41438 | r41439 >
Date:19:03, 30 September 2008
Author:ialex
Status:old (Comments)
Tags:
Comment:
Tweak for r41431: also use wfMsgExt() in Language::getMessageFromDB()
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -402,21 +402,13 @@
403403 }
404404
405405 /**
406 - * Ugly hack to get a message maybe from the MediaWiki namespace, if this
407 - * language object is the content or user language.
 406+ * Get a message from the MediaWiki namespace.
 407+ *
 408+ * @param $msg String: message name
 409+ * @return string
408410 */
409411 function getMessageFromDB( $msg ) {
410 - global $wgContLang, $wgLang;
411 - if ( $wgContLang->getCode() == $this->getCode() ) {
412 - # Content language
413 - return wfMsgForContent( $msg );
414 - } elseif ( $wgLang->getCode() == $this->getCode() ) {
415 - # User language
416 - return wfMsg( $msg );
417 - } else {
418 - # Neither, get from localisation
419 - return $this->getMessage( $msg );
420 - }
 412+ return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
421413 }
422414
423415 function getLanguageName( $code ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41431Fix for r41430: wfMsgExt() now accepts a Language object in the language key ...ialex17:15, 30 September 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   20:24, 30 September 2008

Cleaner code makes me happy!

Status & tagging log