X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fi18n.php;h=2ce053dc8711d911a6f2f1440282f2cbfd75c1c5;hb=0d15cd1991b01408b96bfd7699dba4f4cee39df9;hp=5f94e0a70d78ed93ce0d1f2c1e6043ff2568647d;hpb=5f2d92d076a51da1241a0032e0365b019ad4d94e;p=squirrelmail.git diff --git a/functions/i18n.php b/functions/i18n.php index 5f94e0a7..2ce053dc 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -24,6 +24,11 @@ $languages['ca']['CHARSET'] = 'iso-8859-1'; $languages['ca_CA']['ALIAS'] = 'ca'; + /* PLEASE DON'T TOUCH!!! + * Correct locale name, which should be set by setlocale and/or putenv('LC_ALL='...) + * is 'cs_CZ' and NOT 'cs', this applies to all locale names, look into docs, if you + * don't believe me. Ondrej Sury, czech and slovak translator. + */ $languages['cs_CZ']['NAME'] = 'Czech'; $languages['cs_CZ']['CHARSET'] = 'iso-8859-2'; @@ -112,13 +117,26 @@ $languages['sv_SV']['ALIAS'] = 'sv'; $languages['tr']['NAME'] = 'Turkish'; - $languages['tr']['CHARSET'] = 'iso-8859-1'; + $languages['tr']['CHARSET'] = 'iso-8859-9'; $languages['tr_TR']['ALIAS'] = 'tr'; $languages['tw']['NAME'] = 'Taiwan'; $languages['tw']['CHARSET'] = 'big5'; $languages['tw_TW']['ALIAS'] = 'tw'; + $languages['sk_SK']['NAME'] = 'Slovak'; + $languages['sk_SK']['CHARSET'] = 'iso-8859-2'; + + $languages['ro']['NAME'] = 'Romanian'; + $languages['ro']['CHARSET'] = 'iso-8859-2'; + $languages['ro_RO']['ALIAS'] = 'ro'; + + $languages['th']['NAME'] = 'Thai'; + $languages['th']['CHARSET'] = 'tis-620'; + + $languages['lt']['NAME'] = 'Lithuanian'; + $languages['lt']['CHARSET'] = 'iso-8859-13'; + $languages['lt_LT']['ALIAS'] = 'lt'; // Decodes a string to the internal encoding from the given charset function charset_decode ($charset, $string) { @@ -305,7 +323,7 @@ // Only do the slow convert if there are 8-bit characters if (! ereg("[\200-\377]", $string)) return $string; - + // NO-BREAK SPACE $string = str_replace("\240", ' ', $string); // LATIN CAPITAL LETTER A WITH OGONEK @@ -508,11 +526,11 @@ if (strtolower($default_charset) == 'iso-8859-7') return $string; - + // Only do the slow convert if there are 8-bit characters if (!ereg("[\200-\377]", $string)) return $string; - + // Some diverse characters in the beginning $string = str_replace("\240", ' ', $string); $string = str_replace("\241", '‘', $string); @@ -548,7 +566,7 @@ // These are Unicode 900-902 while (ereg("([\270-\272])", $string, $res)) { $replace = '&#' . (ord($res[1])+720) . ";"; - $string = str_replace($res[1], $replace, $string); + $string = str_replace($res[1], $replace, $string); } // 11/11 (0xBB) Right angle quotation mark is the same as in @@ -558,7 +576,7 @@ // 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 = str_replace($res[1], $replace, $string); } return $string; @@ -633,7 +651,7 @@ if ($default_charset == 'koi8-r') return $string; - + // Convert to Unicode HTML entities. // This code is rather ineffective. $string = str_replace("\200", '─', $string); @@ -783,7 +801,7 @@ // If we can fake gettext, try that elseif ($gettext_flags == 0) { $use_gettext = true; - include('../functions/gettext.php'); + include_once('../functions/gettext.php'); } else { // Uh-ho. A weird install if (! $gettext_flags & 1) { @@ -801,12 +819,11 @@ // Set up the language to be output // if $do_search is true, then scan the browser information // for a possible language that we know - function set_up_language($sm_language, $do_search = false) - { + function set_up_language($sm_language, $do_search = false) { static $SetupAlready = 0; global $HTTP_ACCEPT_LANGUAGE, $use_gettext, $languages, $squirrelmail_language, $squirrelmail_default_language, - $sm_notAlias; + $sm_notAlias; if ($SetupAlready) return; @@ -818,15 +835,15 @@ if ($do_search && ! $sm_language && isset($HTTP_ACCEPT_LANGUAGE)) { $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2); } - if (! $sm_language && isset($squirrelmail_default_language)) - $sm_language = $squirrelmail_default_language; + if (!$sm_language && isset($squirrelmail_default_language)) + $squirrelmail_language = $squirrelmail_default_language; $sm_notAlias = $sm_language; while (isset($languages[$sm_notAlias]['ALIAS'])) $sm_notAlias = $languages[$sm_notAlias]['ALIAS']; if (isset($sm_language) && $use_gettext && - $squirrelmail_language != '' && - isset($languages[$sm_notAlias]['CHARSET'])) { + $sm_language != '' && + isset($languages[$sm_notAlias]['CHARSET'])) { if ((ini_get('safe_mode') == FALSE) && (getenv('LC_ALL') != $sm_language)) { putenv('LC_ALL=' . $sm_notAlias); } @@ -856,4 +873,4 @@ if ($my_charset) $default_charset=$my_charset; } -?> +?> \ No newline at end of file