Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -290,6 +290,14 @@ |
291 | 291 | if( !isset( $this->uploadDir ) ) { |
292 | 292 | $this->uploadDir = $this->setupUploadDir(); |
293 | 293 | } |
| 294 | + |
| 295 | + if( preg_match( '/language=([a-z]+(?:_[a-z]+)?)/', $opts, $m ) ) { |
| 296 | + $lang = $m[1]; |
| 297 | + } else { |
| 298 | + $lang = 'en'; |
| 299 | + } |
| 300 | + $langClass = 'Language' . str_replace( '-', '_', ucfirst( $lang ) ); |
| 301 | + $langObj = setupLangObj( $langClass ); |
294 | 302 | |
295 | 303 | $settings = array( |
296 | 304 | 'wgServer' => 'http://localhost', |
— | — | @@ -302,13 +310,13 @@ |
303 | 311 | 'wgStyleSheetPath' => '/skins', |
304 | 312 | 'wgSitename' => 'MediaWiki', |
305 | 313 | 'wgServerName' => 'Britney Spears', |
306 | | - 'wgLanguageCode' => 'en', |
307 | | - 'wgContLanguageCode' => 'en', |
| 314 | + 'wgLanguageCode' => $lang, |
| 315 | + 'wgContLanguageCode' => $lang, |
308 | 316 | 'wgDBprefix' => 'parsertest_', |
309 | 317 | 'wgDefaultUserOptions' => array(), |
310 | 318 | |
311 | | - 'wgLang' => new LanguageUtf8(), |
312 | | - 'wgContLang' => new LanguageUtf8(), |
| 319 | + 'wgLang' => $langObj, |
| 320 | + 'wgContLang' => $langObj, |
313 | 321 | 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)), |
314 | 322 | 'wgMaxTocLevel' => 999, |
315 | 323 | 'wgCapitalLinks' => true, |
Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | # subpage enable subpages (disabled by default) |
20 | 20 | # noxml don't check for XML well formdness |
21 | 21 | # title=[[XXX]] run test using article title XXX |
| 22 | +# language=XXX set content language to XXX for this test |
22 | 23 | # disabled do not run test |
23 | 24 | # |
24 | 25 | # For testing purposes, temporary articles can created: |
— | — | @@ -3754,6 +3755,27 @@ |
3755 | 3756 | Something, but defenetly not <br id="9" />... |
3756 | 3757 | !! end |
3757 | 3758 | |
| 3759 | +!! test |
| 3760 | +Language converter: output gets cut off unexpectedly (bug 5757) |
| 3761 | +!! options |
| 3762 | +language=zh |
| 3763 | +!! input |
| 3764 | +this bit is safe: }- |
| 3765 | + |
| 3766 | +but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}- |
| 3767 | + |
| 3768 | +then we get cut off here: }- |
| 3769 | + |
| 3770 | +all additional text is vanished |
| 3771 | +!! result |
| 3772 | +<p>this bit is safe: }- |
| 3773 | +</p><p>but if we add a conversion instance: xxx |
| 3774 | +</p><p>then we get cut off here: }- |
| 3775 | +</p><p>all additional text is vanished |
| 3776 | +</p> |
| 3777 | +!! end |
| 3778 | + |
| 3779 | + |
3758 | 3780 | TODO: |
3759 | 3781 | more images |
3760 | 3782 | more tables |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -147,7 +147,9 @@ |
148 | 148 | * Cleaned up formatNum usage in langfiles |
149 | 149 | * (bug 5716) Warn when a user tries to upload a file which was previously deleted |
150 | 150 | * (bug 5565) Add a class attribute to the table on Special:Allpages |
| 151 | +* "lang=xx" option for parser test cases to set content language |
151 | 152 | |
| 153 | + |
152 | 154 | == Compatibility == |
153 | 155 | |
154 | 156 | Older PHP 4.2 and 4.1 releases are no longer supported; PHP 4 users must |