+ $args = func_get_args();
+ if ( isset( $args[0] ) && is_array( $args[0] ) ) {
+ $args = $args[0];
+ }
+ $args_values = array_values( $args );
+ $this->parameters = array_merge( $this->parameters, $args_values );
+ return $this;
+ }
+
+ /**
+ * Add parameters that are substituted after parsing or escaping.
+ * In other words the parsing process cannot access the contents
+ * of this type of parameter, and you need to make sure it is
+ * sanitized beforehand. The parser will see "$n", instead.
+ * @param Varargs: raw parameters as Strings
+ * @return Message: $this
+ */
+ public function rawParams( /*...*/ ) {
+ $params = func_get_args();
+ if ( isset( $params[0] ) && is_array( $params[0] ) ) {
+ $params = $params[0];
+ }
+ foreach( $params as $param ) {
+ $this->parameters[] = self::rawParam( $param );
+ }
+ return $this;
+ }
+
+ /**
+ * Add parameters that are numeric and will be passed through
+ * Language::formatNum before substitution
+ * @param Varargs: numeric parameters
+ * @return Message: $this
+ */
+ public function numParams( /*...*/ ) {
+ $params = func_get_args();
+ if ( isset( $params[0] ) && is_array( $params[0] ) ) {
+ $params = $params[0];
+ }
+ foreach( $params as $param ) {
+ $this->parameters[] = self::numParam( $param );
+ }
+ return $this;
+ }
+
+ /**
+ * Request the message in any language that is supported.
+ * As a side effect interface message status is unconditionally
+ * turned off.
+ * @param $lang Mixed: language code or Language object.
+ * @return Message: $this
+ */
+ public function inLanguage( $lang ) {
+ if ( $lang instanceof Language || $lang instanceof StubUserLang ) {
+ $this->language = $lang;
+ } elseif ( is_string( $lang ) ) {
+ if( $this->language->getCode() != $lang ) {
+ $this->language = Language::factory( $lang );
+ }
+ } else {
+ $type = gettype( $lang );
+ throw new MWException( __METHOD__ . " must be "
+ . "passed a String or Language object; $type given"
+ );
+ }
+ $this->interface = false;