* @return mixed|string
*/
static function formatDate( $parser, $date, $defaultPref = null ) {
- $df = DateFormatter::getInstance();
+ $lang = $parser->getFunctionLang();
+ $df = DateFormatter::getInstance( $lang );
$date = trim( $date );
$title = SpecialPage::getTitleFor( $page, $subpage );
return $title->getPrefixedText();
} else {
- return wfMsgForContent( 'nosuchspecialpage' );
+ return wfMessage( 'nosuchspecialpage' )->inContentLanguage()->text();
}
}
return '';
} else {
return( '<span class="error">' .
- wfMsgForContent( 'duplicate-defaultsort',
- htmlspecialchars( $old ),
- htmlspecialchars( $text ) ) .
+ wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
'</span>' );
}
}
// or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}
public static function filepath( $parser, $name='', $argA='', $argB='' ) {
$file = wfFindFile( $name );
- $isNowiki = false;
if( $argA == 'nowiki' ) {
// {{filepath: | option [| size] }}
$stripList = $parser->getStripList();
if ( !in_array( $tagName, $stripList ) ) {
return '<span class="error">' .
- wfMsgForContent( 'unknown_extension_tag', $tagName ) .
+ wfMessage( 'unknown_extension_tag', $tagName )->inContentLanguage()->text() .
'</span>';
}