cvs: phpweb /include languages.inc
| From: | Gabor Hojtsy | Date: | Fri, 23 May 2003 20:32:16 +0000 |
| Subject: | cvs: phpweb /include languages.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17979@lists.php.net to get a copy of this message | ||
goba Fri May 23 16:32:16 2003 EDT
Modified files:
/phpweb/include languages.inc
Log:
Add a language code conversion function, which
will be used on manual pages
Index: phpweb/include/languages.inc
diff -u phpweb/include/languages.inc:1.7 phpweb/include/languages.inc:1.8
--- phpweb/include/languages.inc:1.7 Sun May 11 17:34:30 2003
+++ phpweb/include/languages.inc Fri May 23 16:32:16 2003
@@ -1,6 +1,6 @@
<?php // -*- C++ -*-
-// $Id: languages.inc,v 1.7 2003/05/11 21:34:30 derick Exp $
+// $Id: languages.inc,v 1.8 2003/05/23 20:32:16 goba Exp $
/*
This is a list of all manual languages hosted
@@ -38,4 +38,26 @@
'sv' => 'Swedish',
'tr' => 'Turkish',
);
-?>
+
+// Convert between language codes back and forth
+// [We use non standard languages codes and so conversion
+// is needed when communicating with the outside world]
+function language_convert($langcode, $to_phpweb_format = TRUE)
+{
+ if ($to_phpweb_format) {
+ switch ($langcode) {
+ case 'zh_cn': return 'zh';
+ case 'zh_hk': return 'hk';
+ case 'zh_tw': return 'tw';
+ default: return $langcode;
+ }
+ }
+ else {
+ switch ($langcode) {
+ case 'cn': return 'zh_cn';
+ case 'hk': return 'zh_hk';
+ case 'tw': return 'zh_tw';
+ default: return $langcode;
+ }
+ }
+}