Previously we only passed on if we were interface or content, but if we're rendering for some third alternative it didn't get used.
Note that parse and parseinline are probably still wrong.... some better model may be required here.
Also it may be wrong in the case of fallbacks ... if you get an English message, is it right to use the Czech magic word parsing?
Hmm.
Might back it out if there's a better way. :)
} elseif ( in_array('parsemag', $options) ) {
global $wgMessageCache;
if ( isset( $wgMessageCache ) ) {
- $string = $wgMessageCache->transform( $string, !$forContent );
+ $string = $wgMessageCache->transform( $string,
+ !$forContent,
+ is_object( $langCode ) ? $langCode : null );
}
}
return $message;
}
- function transform( $message, $interface = false ) {
+ function transform( $message, $interface = false, $language = null ) {
// Avoid creating parser if nothing to transfrom
if( strpos( $message, '{{' ) === false ) {
return $message;
if ( $this->mParser ) {
$popts = $this->getParserOptions();
$popts->setInterfaceMessage( $interface );
+ $popts->setTargetLanguage( $language );
$message = $this->mParser->transformMsg( $message, $popts );
}
return $message;