From: Zheng Zhu Date: Fri, 17 Sep 2004 18:27:06 +0000 (+0000) Subject: added the getVariant() interface to get a list of supported language variants X-Git-Tag: 1.5.0alpha1~1979 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=324952f9a0dee322769464d4e482e10154270349;p=lhc%2Fweb%2Fwiklou.git added the getVariant() interface to get a list of supported language variants --- diff --git a/languages/Language.php b/languages/Language.php index 297ad05f5c..dd808d7fd2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -527,6 +527,7 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen 'youremail' => 'Your email*', 'yourrealname' => 'Your real name*', 'yourlanguage' => 'Interface language', +'yourvariant' => 'Language variant', 'yournick' => 'Your nickname (for signatures)', 'emailforlost' => "Fields marked with a star (*) are optional. Storing an email address enables people to contact you through the website without you having to reveal your email address to them, and it can be used to send you a new password if you forget it.

Your real name, if you choose to provide it, will be used for giving you attribution for your work.", @@ -1961,6 +1962,12 @@ class Language { function convert( $text ) { return $text; } + + # see if we have a list of language variants for conversion. + # right now mainly used in the Chinese conversion + function getVariants() { + return array(); + } } # This should fail gracefully if there's not a localization available diff --git a/languages/LanguageZh.php b/languages/LanguageZh.php index 6ed75a90eb..aad79fb141 100644 --- a/languages/LanguageZh.php +++ b/languages/LanguageZh.php @@ -57,11 +57,12 @@ class LanguageZh extends LanguageUtf8 { } function convert($text) { - + // no conversion if redirecting if(substr($text,0,9) == "#REDIRECT") { return $text; } + // determine the preferred language from the request header $tolang = $this->getPreferredLanguage(); @@ -96,10 +97,13 @@ class LanguageZh extends LanguageUtf8 { $text = $text.$this->simp2trad($a{1}); } } + return $text; } - + function getVariants() { + return array("zh_cn", "zh_tw"); + } /* these just calls the method of the corresponding class */