mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-11-15 11:59:54 +00:00
better language handling - abandon magic language switch in favor of using int:lang as parameter, use parser->getFunctionLang() instead of wgContLanguage in case of use in interface messages
This commit is contained in:
parent
752dd28e01
commit
a3dd6784c8
|
@ -505,14 +505,11 @@ class ExtParserFunctions {
|
|||
return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_long' ) . '</strong>';
|
||||
} else {
|
||||
if ( $ts < 100000000000000 ) { // Language can't deal with years after 9999
|
||||
if ( $language == 'user' ) { // use user's interface language
|
||||
$parser->getOptions()->getUserLang();
|
||||
$result = $wgLang->sprintfDate( $format, $ts );
|
||||
} elseif ( $language !== '' ) { // use whatever language is passed as a parameter
|
||||
if ( $language !== '' ) { // use whatever language is passed as a parameter
|
||||
$langObject = Language::factory( $language );
|
||||
$result = $langObject->sprintfDate( $format, $ts );
|
||||
} else { // use wiki's content language
|
||||
$result = $wgContLang->sprintfDate( $format, $ts );
|
||||
$result = $parser->getFunctionLang()->sprintfDate( $format, $ts );
|
||||
}
|
||||
} else {
|
||||
return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_big' ) . '</strong>';
|
||||
|
|
Loading…
Reference in a new issue