From: Jens Frank Date: Fri, 17 Sep 2004 05:51:03 +0000 (+0000) Subject: Added convert() to Language class, so that convert can be called X-Git-Tag: 1.5.0alpha1~1993 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=ff264a485a262f0aab1f1df7ce774c67ee3a450b;p=lhc%2Fweb%2Fwiklou.git Added convert() to Language class, so that convert can be called without checking wgLanguageCode. Avoid hardcodes. --- diff --git a/includes/Parser.php b/includes/Parser.php index 2703fe4b26..4bb512ad7d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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
', $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 ); diff --git a/languages/Language.php b/languages/Language.php index 41985e4126..297ad05f5c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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