From: Alexandre Emsenhuber Date: Fri, 4 Feb 2011 16:52:26 +0000 (+0000) Subject: Use wfMessage() instead of wfMsgGetKey() X-Git-Tag: 1.31.0-rc.0~32204 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=dfd6988313d7033c8294d4b1ce7d9e92604501dc;p=lhc%2Fweb%2Fwiklou.git Use wfMessage() instead of wfMsgGetKey() --- diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index c441f06c92..cf706f2da1 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -212,8 +212,8 @@ class MediaTransformError extends MediaTransformOutput { $htmlArgs = array_map( 'htmlspecialchars', $args ); $htmlArgs = array_map( 'nl2br', $htmlArgs ); - $this->htmlMsg = wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $msg, true ) ), $htmlArgs ); - $this->textMsg = wfMsgReal( $msg, $args ); + $this->htmlMsg = wfMessage( $msg )->rawParams( $htmlArgs )->escaped(); + $this->textMsg = wfMessage( $msg )->rawParams( $htmlArgs )->text(); $this->width = intval( $width ); $this->height = intval( $height ); $this->url = false; diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index b76c7985d0..88349b6412 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -86,8 +86,7 @@ class CoreParserFunctions { static function intFunction( $parser, $part1 = '' /*, ... */ ) { if ( strval( $part1 ) !== '' ) { $args = array_slice( func_get_args(), 2 ); - $message = wfMsgGetKey( $part1, true, $parser->getOptions()->getUserLang(), false ); - $message = wfMsgReplaceArgs( $message, $args ); + $message = wfMessage( $part1, $args )->inLanguage( $parser->getOptions()->getUserLang() )->plain(); $message = $parser->replaceVariables( $message ); // like MessageCache::transform() return $message; } else { diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index b562ebc6ee..fdacd80942 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -265,10 +265,12 @@ class AllmessagesTablePager extends TablePager { ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) && ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix === false ) ){ + $actual = wfMessage( $key )->inLanguage( $this->langcode )->plain(); + $default = wfMessage( $key )->inLanguage( $this->langcode )->useDatabase( false )->plain(); $result->result[] = array( 'am_title' => $key, - 'am_actual' => wfMsgGetKey( $key, /*useDB*/true, $this->langcode, false ), - 'am_default' => wfMsgGetKey( $key, /*useDB*/false, $this->langcode, false ), + 'am_actual' => $actual, + 'am_default' => $default, 'am_customised' => $customised, 'am_talk_exists' => isset( $statuses['talks'][$key] ) );