From: Alexandre Emsenhuber Date: Mon, 10 Sep 2012 17:55:20 +0000 (+0200) Subject: Convert last usages of wfMsg*() to wfMessage(). X-Git-Tag: 1.31.0-rc.0~22391^2 X-Git-Url: http://git.cyclocoop.org/%27.generer_url_ecrire%28%27admin_couteau_suisse%27%2C%27cmd=descrip&outil=boites_privees?a=commitdiff_plain;h=e10cb28eca94e42ec556a3ee6ec24d60d0c8f00d;p=lhc%2Fweb%2Fwiklou.git Convert last usages of wfMsg*() to wfMessage(). Change-Id: Ia0f8c196a77edd0cd60cb1a4880342e831e8b49d --- diff --git a/includes/WikiError.php b/includes/WikiError.php index 4b0e68cfa5..45ee20c9f2 100644 --- a/includes/WikiError.php +++ b/includes/WikiError.php @@ -91,22 +91,22 @@ class WikiErrorMsg extends WikiError { wfDeprecated( __METHOD__, '1.17' ); $args = func_get_args(); array_shift( $args ); - $this->mMessage = wfMsgReal( $message, $args, true ); + $this->mMessage = wfMessage( $message )->rawParams( $args )->text(); $this->mMsgKey = $message; $this->mMsgArgs = $args; } - + function getMessageKey() { return $this->mMsgKey; } - + function getMessageArgs() { return $this->mMsgArgs; } } /** - * Error class designed to handle errors involved with + * Error class designed to handle errors involved with * XML parsing * @ingroup Exception */ diff --git a/tests/jasmine/spec_makers/makeJqueryMsgSpec.php b/tests/jasmine/spec_makers/makeJqueryMsgSpec.php index 43015878af..92c36d6e48 100644 --- a/tests/jasmine/spec_makers/makeJqueryMsgSpec.php +++ b/tests/jasmine/spec_makers/makeJqueryMsgSpec.php @@ -51,27 +51,22 @@ class MakeLanguageSpec extends Maintenance { private function getMessagesAndTests() { $messages = array(); $tests = array(); - $wfMsgExtOptions = array( 'parsemag' ); foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { - $wfMsgExtOptions['language'] = $languageCode; foreach ( self::$keyToTestArgs as $key => $testArgs ) { foreach ($testArgs as $args) { // get the raw template, without any transformations $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); - // get the magic-parsed version with args - $wfMsgExtArgs = array_merge( array( $key, $wfMsgExtOptions ), $args ); - // @todo FIXME: Use Message class. - $result = call_user_func_array( 'wfMsgExt', $wfMsgExtArgs ); + $result = wfMessage( $key, $args )->inLanguage( $languageCode )->text(); // record the template, args, language, and expected result - // fake multiple languages by flattening them together + // fake multiple languages by flattening them together $langKey = $languageCode . '_' . $key; $messages[ $langKey ] = $template; - $tests[] = array( + $tests[] = array( 'name' => $languageCode . " " . $key . " " . join( ",", $args ), 'key' => $langKey, - 'args' => $args, + 'args' => $args, 'result' => $result, 'lang' => $languageCode );