* @return Message: $this
*/
public function __construct( $key, $params = array() ) {
+ global $wgLang;
$this->key = $key;
$this->parameters = array_values( $params );
+ $this->language = $wgLang;
}
/**
* @return Message: $this
*/
public function inContentLanguage() {
+ global $wgContLang;
$this->interface = false;
- $this->language = null;
+ $this->language = $wgContLang;
return $this;
}
/**
* Returns the message text. {{-transformation is done and the result
- * is excaped excluding any raw parameters.
+ * is escaped excluding any raw parameters.
* @return String: Escaped message text.
*/
public function escaped() {
* @return Wikitext parsed into HTML
*/
protected function parseText( $string ) {
- global $wgOut;
- if ( $this->language !== null ) {
+ global $wgOut, $wgLang, $wgContLang;
+ if ( $this->language !== $wgLang && $this->language !== $wgContLang ) {
# FIXME: remove this limitation
throw new MWException( 'Can only parse in interface or content language' );
}