Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -114,6 +114,8 @@ |
115 | 115 | * You shouldn't use this. Really. $parser->getFunctionLang() is all you need. |
116 | 116 | * Using this fragments the cache and is discouraged. Yes, {{int: }} uses this, |
117 | 117 | * producing inconsistent tables (Bug 14404). |
| 118 | + * @return String Language code |
| 119 | + * @since 1.17 |
118 | 120 | */ |
119 | 121 | function getUserLang() { |
120 | 122 | $this->optionUsed('userlang'); |
— | — | @@ -143,7 +145,12 @@ |
144 | 146 | function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); } |
145 | 147 | function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); } |
146 | 148 | function setMath( $x ) { return wfSetVar( $this->mMath, $x ); } |
147 | | - function setUserLang( $x ) { return wfSetVar( $this->mUserLang, $x ); } |
| 149 | + function setUserLang( $x ) { |
| 150 | + if ( $x instanceof Language ) { |
| 151 | + $x = $x->getCode(); |
| 152 | + } |
| 153 | + return wfSetVar( $this->mUserLang, $x ); |
| 154 | + } |
148 | 155 | function setThumbSize( $x ) { return wfSetVar( $this->mThumbSize, $x ); } |
149 | 156 | function setStubThreshold( $x ) { return wfSetVar( $this->mStubThreshold, $x ); } |
150 | 157 | function setPreSaveTransform( $x ) { return wfSetVar( $this->mPreSaveTransform, $x ); } |
Index: trunk/extensions/I18nTags/I18nTags_body.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | return ''; |
60 | 60 | } |
61 | 61 | if ( !$outputLanguage ) { |
62 | | - $outputLanguage = $wgLang->getCode(); |
| 62 | + $outputLanguage = $parser->getOptions()->getUserLang(); |
63 | 63 | } |
64 | 64 | $cldr = is_callable( array( 'LanguageNames', 'getNames' )); |
65 | 65 | if ( $outputLanguage !== 'native' && $cldr ) { |