Changeset 641
- Timestamp:
- 05/26/05 21:21:26 (3 years ago)
- Files:
-
- trunk/wifidog-auth/ChangeLog (modified) (1 diff)
- trunk/wifidog-auth/wifidog/classes/Locale.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wifidog-auth/ChangeLog
r638 r641 1 2005-05-26 Benoit Grégoire <bock@step.polymtl.ca> 2 * Someone moved the fallback gettext functions definition (for when gettext isn't installed) inside the static setCurrentLocale method, completely breaking the system when PHP doesn't have gettext support. This is an untested fix. 3 1 4 2005-05-24 Francois Proulx <francois.proulx@gmail.com> 2 5 * Fixed bug in auth.php to let users go through when the click twice on the login button trunk/wifidog-auth/wifidog/classes/Locale.php
r604 r641 27 27 error_reporting(E_ALL); 28 28 29 /* Gettext support */ 30 if (!function_exists('gettext')) 31 { 32 define('GETTEXT_AVAILABLE', false); 33 /* Redefine the gettext functions if gettext isn't installed */ 34 function gettext($string) 35 { 36 return $string; 37 } 38 function _($string) 39 { 40 return $string; 41 } 42 } 43 else 44 { 45 define('GETTEXT_AVAILABLE', true); 46 } 47 29 48 /** Représente un langage humain, possiblement localisé, tel que fr_CA 30 49 */ … … 55 74 { 56 75 //$object = new self(DEFAULT_LANG); 57 $object = self::getObject(DEFAULT_LANG);58 self::setCurrentLocale($object);76 $object = self :: getObject(DEFAULT_LANG); 77 self :: setCurrentLocale($object); 59 78 } 60 79 else 61 80 { 62 81 //$object = new self($locale_id); 63 $object = self::getObject($locale_id);64 self::setCurrentLocale($object);82 $object = self :: getObject($locale_id); 83 self :: setCurrentLocale($object); 65 84 } 66 85 return $object; … … 87 106 $retval = false; 88 107 } 89 /* Gettext support */ 90 if (!function_exists('gettext')) 91 { 92 define('GETTEXT_AVAILABLE', false); 93 /* Redefine the gettext functions if gettext isn't installed */ 94 function gettext($string) 95 { 96 return $string; 97 } 98 function _($string) 99 { 100 return $string; 101 } 102 } 103 else 104 { 105 if(!defined('GETTEXT_AVAILABLE')) 106 define('GETTEXT_AVAILABLE', true); 107 } 108 108 109 109 if (GETTEXT_AVAILABLE) 110 110 { … … 185 185 @param string locale Locale in POSIX format (excluding charset), such as fr ou fr_CA: "xx(x)_YY_(n*z)". Both '_' and '-' are acceptable as separator. 186 186 */ 187 function Locale($p_locale)187 function __construct($p_locale) 188 188 { 189 189 //parent :: __construct();
