Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -7243,6 +7243,20 @@ |
7244 | 7244 | !! end |
7245 | 7245 | |
7246 | 7246 | !! test |
| 7247 | +Bug 24072: more test on conversion rule for title |
| 7248 | +!! options |
| 7249 | +language=zh variant=zh-tw showtitle |
| 7250 | +!! input |
| 7251 | +This should be stripped-{T|zh:China;zh-tw:Taiwan}-! |
| 7252 | +This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-. |
| 7253 | +!! result |
| 7254 | +Taiwan |
| 7255 | +<p>This should be stripped! |
| 7256 | +This won't take interferes with the title rule. |
| 7257 | +</p> |
| 7258 | +!! end |
| 7259 | + |
| 7260 | +!! test |
7247 | 7261 | Raw output of variant escape tags (R flag) |
7248 | 7262 | !! options |
7249 | 7263 | language=zh variant=zh-tw |
Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -488,9 +488,14 @@ |
489 | 489 | * @private |
490 | 490 | */ |
491 | 491 | function applyManualConv( $convRule ) { |
492 | | - // use syntax -{T|zh:TitleZh;zh-tw:TitleTw}- for custom |
493 | | - // conversion in title |
494 | | - $this->mConvRuleTitle = $convRule->getTitle(); |
| 492 | + // Use syntax -{T|zh-cn:TitleCN; zh-tw:TitleTw}- to custom |
| 493 | + // title conversion. |
| 494 | + // Bug 24072: mConvRuleTitle won't work if the title conversion |
| 495 | + // rule was followed by other manual conversion rule(s). |
| 496 | + $newConvRuleTitle = $convRule->getTitle(); |
| 497 | + if( $newConvRuleTitle ) { |
| 498 | + $this->mConvRuleTitle = $newConvRuleTitle; |
| 499 | + } |
495 | 500 | |
496 | 501 | // apply manual conversion table to global table |
497 | 502 | $convTable = $convRule->getConvTable(); |