Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | static function intFunction( $parser, $part1 = '' /*, ... */ ) { |
83 | 83 | if ( strval( $part1 ) !== '' ) { |
84 | 84 | $args = array_slice( func_get_args(), 2 ); |
85 | | - $message = wfMsgGetKey( $part1, true, false, false ); |
| 85 | + $message = wfMsgGetKey( $part1, true, $parser->mOptions->getUserLang(), false ); |
86 | 86 | $message = wfMsgReplaceArgs( $message, $args ); |
87 | 87 | $message = $parser->replaceVariables( $message ); // like $wgMessageCache->transform() |
88 | 88 | return $message; |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -29,6 +29,8 @@ |
30 | 30 | var $mEnableLimitReport; # Enable limit report in an HTML comment on output |
31 | 31 | var $mTimestamp; # Timestamp used for {{CURRENTDAY}} etc. |
32 | 32 | var $mExternalLinkTarget; # Target attribute for external links |
| 33 | + var $mMath; # User math preference (as integer) |
| 34 | + var $mUserLang; # Language code of the User language. |
33 | 35 | |
34 | 36 | var $mUser; # Stored user object, just used to initialise the skin |
35 | 37 | var $mIsPreview; # Parsing the page for a "preview" operation |
— | — | @@ -85,6 +87,13 @@ |
86 | 88 | return $this->mTimestamp; |
87 | 89 | } |
88 | 90 | |
| 91 | + # You shouldn't use this. Really. $parser->getFunctionLang() is all you need. |
| 92 | + # Using this fragments the cache and is discouraged. Yes, {{int: }} uses this, |
| 93 | + # producing inconsistent tables (Bug 14404). |
| 94 | + function getUserLang() { |
| 95 | + return $this->mUserLang; |
| 96 | + } |
| 97 | + |
89 | 98 | function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); } |
90 | 99 | function setInterwikiMagic( $x ) { return wfSetVar( $this->mInterwikiMagic, $x ); } |
91 | 100 | function setAllowExternalImages( $x ) { return wfSetVar( $this->mAllowExternalImages, $x ); } |
— | — | @@ -108,6 +117,7 @@ |
109 | 118 | function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); } |
110 | 119 | function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); } |
111 | 120 | function setMath( $x ) { return wfSetVar( $this->mMath, $x ); } |
| 121 | + function setUserLang( $x ) { return wfSetVar( $this->mUserLang, $x ); } |
112 | 122 | |
113 | 123 | function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); } |
114 | 124 | function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); } |
— | — | @@ -132,7 +142,7 @@ |
133 | 143 | global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; |
134 | 144 | global $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion, $wgMaxArticleSize; |
135 | 145 | global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures; |
136 | | - global $wgExternalLinkTarget; |
| 146 | + global $wgExternalLinkTarget, $wgLang; |
137 | 147 | |
138 | 148 | wfProfileIn( __METHOD__ ); |
139 | 149 | |
— | — | @@ -172,6 +182,7 @@ |
173 | 183 | $this->mCleanSignatures = $wgCleanSignatures; |
174 | 184 | $this->mExternalLinkTarget = $wgExternalLinkTarget; |
175 | 185 | $this->mMath = $user->getOption( 'math' ); |
| 186 | + $this->mUserLang = $wgLang->getCode(); |
176 | 187 | |
177 | 188 | $this->mIsPreview = false; |
178 | 189 | $this->mIsSectionPreview = false; |