static function intFunction( $parser, $part1 = '' /*, ... */ ) {
if ( strval( $part1 ) !== '' ) {
$args = array_slice( func_get_args(), 2 );
- $message = wfMsgGetKey( $part1, true, false, false );
+ $message = wfMsgGetKey( $part1, true, $parser->mOptions->getUserLang(), false );
$message = wfMsgReplaceArgs( $message, $args );
$message = $parser->replaceVariables( $message ); // like $wgMessageCache->transform()
return $message;
var $mEnableLimitReport; # Enable limit report in an HTML comment on output
var $mTimestamp; # Timestamp used for {{CURRENTDAY}} etc.
var $mExternalLinkTarget; # Target attribute for external links
+ var $mMath; # User math preference (as integer)
+ var $mUserLang; # Language code of the User language.
var $mUser; # Stored user object, just used to initialise the skin
var $mIsPreview; # Parsing the page for a "preview" operation
return $this->mTimestamp;
}
+ # You shouldn't use this. Really. $parser->getFunctionLang() is all you need.
+ # Using this fragments the cache and is discouraged. Yes, {{int: }} uses this,
+ # producing inconsistent tables (Bug 14404).
+ function getUserLang() {
+ return $this->mUserLang;
+ }
+
function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); }
function setInterwikiMagic( $x ) { return wfSetVar( $this->mInterwikiMagic, $x ); }
function setAllowExternalImages( $x ) { return wfSetVar( $this->mAllowExternalImages, $x ); }
function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
function setMath( $x ) { return wfSetVar( $this->mMath, $x ); }
+ function setUserLang( $x ) { return wfSetVar( $this->mUserLang, $x ); }
function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); }
function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); }
global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize;
global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures;
- global $wgExternalLinkTarget;
+ global $wgExternalLinkTarget, $wgLang;
wfProfileIn( __METHOD__ );
$this->mCleanSignatures = $wgCleanSignatures;
$this->mExternalLinkTarget = $wgExternalLinkTarget;
$this->mMath = $user->getOption( 'math' );
+ $this->mUserLang = $wgLang->getCode();
$this->mIsPreview = false;
$this->mIsSectionPreview = false;