Added convert() to Language class, so that convert can be called
authorJens Frank <jeluf@users.mediawiki.org>
Fri, 17 Sep 2004 05:51:03 +0000 (05:51 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Fri, 17 Sep 2004 05:51:03 +0000 (05:51 +0000)
without checking wgLanguageCode. Avoid hardcodes.

includes/Parser.php
languages/Language.php

index 2703fe4..4bb512a 100644 (file)
@@ -20,7 +20,7 @@
  *
  * settings:
  *  $wgUseTex*, $wgUseDynamicDates*, $wgInterwikiMagic*,
- *  $wgNamespacesWithSubpages, $wgLanguageCode, $wgAllowExternalImages*,
+ *  $wgNamespacesWithSubpages, $wgAllowExternalImages*,
  *  $wgLocaltimezone
  *
  *  * only within ParserOptions
@@ -579,7 +579,7 @@ class Parser
        }
 
        function internalParse( $text, $linestart, $args = array(), $isMain=true ) {
-        global $wgLanguageCode, $wgLang;
+        global $wgLang;
 
                $fname = 'Parser::internalParse';
                wfProfileIn( $fname );
@@ -587,9 +587,7 @@ class Parser
                $text = $this->removeHTMLtags( $text );
                $text = $this->replaceVariables( $text, $args );
 
-        if($wgLanguageCode == "zh") {
-             $text = $wgLang->convert($text);
-        }
+               $text = $wgLang->convert($text);
 
                $text = preg_replace( '/(^|\n)-----*/', '\\1<hr />', $text );
 
@@ -963,7 +961,7 @@ class Parser
        # The wikilinks [[ ]] are procedeed here.
        /* private */ function replaceInternalLinks( $s ) {
                global $wgLang, $wgLinkCache;
-               global $wgNamespacesWithSubpages, $wgLanguageCode;
+               global $wgNamespacesWithSubpages;
                static $fname = 'Parser::replaceInternalLinks' ;
                wfProfileIn( $fname );
 
index 41985e4..297ad05 100644 (file)
@@ -1956,6 +1956,11 @@ class Language {
        function convertGrammar( $word, $case ) {
                return $word;
        }
+
+       # Hook for Chinese traditional/simplified conversion
+       function convert( $text ) {
+               return $text;
+       }
 }
 
 # This should fail gracefully if there's not a localization available