Changeset 3148
- Timestamp:
- 07/18/2008 07:31:43 AM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/core/Kohana.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r3147 r3148 27 27 public static $user_agent = ''; 28 28 29 // The current locale 30 public static $locale = ''; 31 29 32 // File path cache 30 33 private static $paths; … … 57 60 58 61 // Define Kohana error constant 59 define d('E_KOHANA') or define('E_KOHANA', 42);62 define('E_KOHANA', 42); 60 63 61 64 // Define 404 error constant 62 define d('E_PAGE_NOT_FOUND') or define('E_PAGE_NOT_FOUND', 43);65 define('E_PAGE_NOT_FOUND', 43); 63 66 64 67 // Define database error constant 65 define d('E_DATABASE_ERROR') or define('E_DATABASE_ERROR', 44);68 define('E_DATABASE_ERROR', 44); 66 69 67 70 // Disable error reporting 68 $ER = error_reporting( 0);71 $ER = error_reporting(~E_NOTICE); 69 72 70 73 // Set the user agent … … 108 111 header('Content-type: text/html; charset=UTF-8'); 109 112 113 // Load locales 114 $locales = Config::item('locale.language'); 115 116 // Make first locale UTF-8 117 $locales[0] .= '.UTF-8'; 118 110 119 // Set locale information 111 $locales = Config::item('locale.language'); 112 $locales[0] .= '.UTF-8'; 113 setlocale(LC_ALL, $locales); 120 self::$locale = setlocale(LC_ALL, $locales); 114 121 115 122 if (Config::item('log.threshold') > 0) … … 948 955 949 956 // The name of the file to search for 950 $locale s = Config::item('locale.language');951 $filename = $locale s[0].'/'.$group;957 $locale = Config::item('locale.language.0'); 958 $filename = $locale.'/'.$group; 952 959 953 960 // Loop through the files and include each one, so SYSPATH files … … 979 986 $line = self::key_string($language, $key); 980 987 981 // Return the key string as fallback982 988 if ($line === NULL) 983 989 { 984 $locales = Config::item('locale.language'); 985 Log::add('error', 'Missing i18n entry '.$key.' for language '.$locales[0]); 990 Log::add('error', 'Missing i18n entry '.$key.' for language '.$locale); 991 992 // Return the key string as fallback 986 993 return $key; 987 994 }
