From: Philip Tzou
Date: Tue, 6 Jul 2010 03:06:31 +0000 (+0000)
Subject: Bug 24072: The manual conversion of title was taken interferes by other manual conver...
X-Git-Tag: 1.31.0-rc.0~36249
X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=522608515402a1784123254ee655eec0848cf67d;p=lhc%2Fweb%2Fwiklou.git
Bug 24072: The manual conversion of title was taken interferes by other manual conversion rule(s). This patch fixed the problem and add a new test to parserTests.txt to prevent it to reappear again.
---
diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php
index c9835837a5..f0a4f460b2 100644
--- a/languages/LanguageConverter.php
+++ b/languages/LanguageConverter.php
@@ -488,9 +488,14 @@ class LanguageConverter {
* @private
*/
function applyManualConv( $convRule ) {
- // use syntax -{T|zh:TitleZh;zh-tw:TitleTw}- for custom
- // conversion in title
- $this->mConvRuleTitle = $convRule->getTitle();
+ // Use syntax -{T|zh-cn:TitleCN; zh-tw:TitleTw}- to custom
+ // title conversion.
+ // Bug 24072: mConvRuleTitle won't work if the title conversion
+ // rule was followed by other manual conversion rule(s).
+ $newConvRuleTitle = $convRule->getTitle();
+ if( $newConvRuleTitle ) {
+ $this->mConvRuleTitle = $newConvRuleTitle;
+ }
// apply manual conversion table to global table
$convTable = $convRule->getConvTable();
diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
index 908f466df3..617ad8be5b 100644
--- a/maintenance/parserTests.txt
+++ b/maintenance/parserTests.txt
@@ -7242,6 +7242,20 @@ China
!! end
+!! test
+Bug 24072: more test on conversion rule for title
+!! options
+language=zh variant=zh-tw showtitle
+!! input
+This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
+This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
+!! result
+Taiwan
+This should be stripped!
+This won't take interferes with the title rule.
+
+!! end
+
!! test
Raw output of variant escape tags (R flag)
!! options