Bug 24072: The manual conversion of title was taken interferes by other manual conver...
authorPhilip Tzou <philip@users.mediawiki.org>
Tue, 6 Jul 2010 03:06:31 +0000 (03:06 +0000)
committerPhilip Tzou <philip@users.mediawiki.org>
Tue, 6 Jul 2010 03:06:31 +0000 (03:06 +0000)
languages/LanguageConverter.php
maintenance/parserTests.txt

index c983583..f0a4f46 100644 (file)
@@ -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();
index 908f466..617ad8b 100644 (file)
@@ -7242,6 +7242,20 @@ China
 </p>
 !! 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
+<p>This should be stripped!
+This won't take interferes with the title rule.
+</p>
+!! end
+
 !! test
 Raw output of variant escape tags (R flag)
 !! options