From: Tyler A. <fi...@us...> - 2001-04-27 03:25:41
|
Update of /cvsroot/squirrelmail/squirrelmail/functions In directory usw-pr-cvs1:/tmp/cvs-serv26973 Modified Files: i18n.php Log Message: * Removed one language (it wasn't in the CVS so I commented it out) * Minor modifications to detection of gettext * Auto-load of gettext.php if gettext isn't compiled into PHP Thank you Konstantin! Index: i18n.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/functions/i18n.php,v retrieving revision 1.52 retrieving revision 1.53 diff -u -w -r1.52 -r1.53 --- i18n.php 2001/04/19 17:57:28 1.52 +++ i18n.php 2001/04/27 03:25:38 1.53 @@ -29,8 +29,8 @@ $languages['hr']['NAME'] = 'Croatian'; $languages['hr']['CHARSET'] = 'iso-8859-2'; - $languages['cs_CZ']['NAME'] = 'Czech'; - $languages['cs_CZ']['CHARSET'] = 'iso-8859-2'; + //$languages['cs_CZ']['NAME'] = 'Czech'; + //$languages['cs_CZ']['CHARSET'] = 'iso-8859-2'; $languages['da']['NAME'] = 'Danish'; $languages['da']['CHARSET'] = 'iso-8859-1'; @@ -737,25 +737,30 @@ global $use_gettext; // Detect whether gettext is installed. - // If it is, set the flag so we can use it. - if (! function_exists('_') || - ! function_exists('bindtextdomain') || - ! function_exists('textdomain')) - $use_gettext = false; - else - $use_gettext = true; + $gettext_flags = 0; + if (function_exists('_')) $gettext_flags += 1; + if (function_exists('bindtextdomain')) $gettext_flags += 2; + if (function_exists('textdomain')) $gettext_flags += 4; - - // Avoid warnings/errors if gettext is not installed - if (! function_exists('_')) { + // If gettext is fully loaded, cool + if ($gettext_flags == 7) + $use_gettext = true; + // If we can fake gettext, try that + elseif ($gettext_flags == 0) { + $use_gettext = true; + include('../functions/gettext.php'); + } else { + // Uh-ho. A weird install + if (! $gettext_flags & 1) { function _($str) { return $str; }; } - if (! function_exists('bindtextdomain')) { + if (! $gettext_flags & 2) { function bindtextdomain() { return; } } - if (! function_exists('textdomain')) { + if (! $gettext_flags & 4) { function textdomain() { return; } } + } // Set up the language to be output |