make the failure to set the \Answered flag on a message when replying
[squirrelmail.git] / functions / i18n.php
index 01f90a2cb9418c709fc654a91f71a9fcab7691fc..82242dd3a543d5a2b7505d7fb9d378dc1a5ae540 100644 (file)
@@ -435,11 +435,8 @@ function charset_decode_iso_8859_7 ($string) {
      * ISO-8859-7 characters from 11/04 (0xB4) to 11/06 (0xB6)
      * These are Unicode 900-902
      */
-    while (ereg("([\264-\266])", $string, $res)) {
-        $replace = '&#' . (ord($res[1])+720) . ';';
-        $string = str_replace($res[1], $replace, $string);
-    }
-
+    $string = preg_replace("/([\264-\266])/","'&#' . (ord(\\1)+720)",$string);
+    
     /* 11/07 (0xB7) Middle dot is the same in iso-8859-1 */
     $string = str_replace("\267", '·', $string);
 
@@ -447,10 +444,7 @@ function charset_decode_iso_8859_7 ($string) {
      * ISO-8859-7 characters from 11/08 (0xB8) to 11/10 (0xBA)
      * These are Unicode 900-902
      */
-    while (ereg("([\270-\272])", $string, $res)) {
-        $replace = '&#' . (ord($res[1])+720) . ";";
-        $string = str_replace($res[1], $replace, $string);
-    }
+    $string = preg_replace("/([\270-\272])/","'&#' . (ord(\\1)+720)",$string);
 
     /*
      * 11/11 (0xBB) Right angle quotation mark is the same as in
@@ -459,10 +453,7 @@ function charset_decode_iso_8859_7 ($string) {
     $string = str_replace("\273", '»', $string);
 
     /* And now the rest of the charset */
-    while (ereg("([\274-\376])", $string, $res)) {
-        $replace = '&#' . (ord($res[1])+720) . ';';
-        $string = str_replace($res[1], $replace, $string);
-    }
+    $string = preg_replace("/([\274-\376])/","'&#' . (ord(\\1)+720)",$string);
 
     return $string;
 }
@@ -475,7 +466,7 @@ function charset_decode_iso_8859_15 ($string) {
     // Euro sign
     $string = str_replace ("\244", '€', $string);
     // Latin capital letter S with caron
-    $string = str_replace ("\244", 'Š', $string);
+    $string = str_replace ("\246", 'Š', $string);
     // Latin small letter s with caron
     $string = str_replace ("\250", 'š', $string);
     // Latin capital letter Z with caron
@@ -492,7 +483,7 @@ function charset_decode_iso_8859_15 ($string) {
     return (charset_decode_iso_8859_1($string));
 }
 
-/* ISO-8859-15 is Cyrillic */
+/* ISO-8859-5 is Cyrillic */
 function charset_decode_iso_8859_5 ($string) {
     // Convert to KOI8-R, then return this decoded.
     $string = convert_cyr_string($string, 'i', 'k');
@@ -869,12 +860,14 @@ $languages['tr_TR']['NAME']    = 'Turkish';
 $languages['tr_TR']['CHARSET'] = 'iso-8859-9';
 $languages['tr']['ALIAS'] = 'tr_TR';
 
-// it's zh_TW, actually.
-
 $languages['zh_TW']['NAME']    = 'Taiwan';
 $languages['zh_TW']['CHARSET'] = 'big5';
 $languages['tw']['ALIAS'] = 'zh_TW';
 
+$languages['zh_TW']['NAME']    = 'Chinese';
+$languages['zh_TW']['CHARSET'] = 'gb2312';
+$languages['tw']['ALIAS'] = 'zh_CN';
+
 $languages['sk_SK']['NAME']     = 'Slovak';
 $languages['sk_SK']['CHARSET']  = 'iso-8859-2';
 $languages['sk']['ALIAS']       = 'sk_SK';
@@ -899,6 +892,14 @@ $languages['bg_BG']['NAME']    = 'Bulgarian';
 $languages['bg_BG']['CHARSET'] = 'windows-1251';
 $languages['bg']['ALIAS'] = 'bg_BG';
 
+// Right to left languages
+
+$languages['he_HE']['NAME']    = 'Hebrew';
+$languages['he_HE']['CHARSET'] = 'windows-1255';
+$languages['he_HE']['DIR']     = 'rtl';
+$languages['he']['ALIAS']      = 'he_HE';
+
+
 /* Detect whether gettext is installed. */
 $gettext_flags = 0;
 if (function_exists('_')) {