http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69080

Revision: 69080
Author:   philip
Date:     2010-07-06 03:06:31 +0000 (Tue, 06 Jul 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/phase3/languages/LanguageConverter.php
    trunk/phase3/maintenance/parserTests.txt

Modified: trunk/phase3/languages/LanguageConverter.php
===================================================================
--- trunk/phase3/languages/LanguageConverter.php        2010-07-06 01:30:30 UTC 
(rev 69079)
+++ trunk/phase3/languages/LanguageConverter.php        2010-07-06 03:06:31 UTC 
(rev 69080)
@@ -488,9 +488,14 @@
         * @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();

Modified: trunk/phase3/maintenance/parserTests.txt
===================================================================
--- trunk/phase3/maintenance/parserTests.txt    2010-07-06 01:30:30 UTC (rev 
69079)
+++ trunk/phase3/maintenance/parserTests.txt    2010-07-06 03:06:31 UTC (rev 
69080)
@@ -7243,6 +7243,20 @@
 !! 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
 language=zh variant=zh-tw



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to