Changeset 1071 in ExiteCMS for trunk/includes/locale_functions.php
- Timestamp:
- 11/06/07 17:12:56 (5 years ago)
- File:
-
- 1 edited
-
trunk/includes/locale_functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/locale_functions.php
r1070 r1071 54 54 } 55 55 56 // locale defines (no longer needed once we moved to the new locale system!) 57 56 // locale defines 58 57 define("PATH_LOCALE", PATH_ROOT."locale/"); 59 60 // locale detection - step 3 - use the website's default 61 if (!defined('LOCALESET')) { 62 define("LOCALESET", $settings['locale']."/"); 63 } 58 if (!defined('LOCALESET')) define("LOCALESET", $settings['locale']."/"); 64 59 65 60 // Initialise the $locale array … … 75 70 76 71 global $settings, $locale; 77 72 78 73 // assemble the locale filename 79 $locales_file = PATH_ROOT."files/ ".$locale['locale'].".".$locale_name.".php";74 $locales_file = PATH_ROOT."files/locales/".$locale['locale'].".".$locale_name.".php"; 80 75 81 76 // check if we need to recompile from the database … … 109 104 fwrite($handle, "?>"."\n"); 110 105 fclose($handle); 106 } else { 107 trigger_error("ExiteCMS locales error: no write access to ".$locales_file."!", E_USER_ERROR); 111 108 } 112 109 } … … 127 124 break; 128 125 126 case "forum": // forum modules 127 $locales_file = PATH_LOCALE.$settings['locale']."/forum/".$nameparts[1].".php"; 128 break; 129 129 130 case "main": // main modules 130 131 $locales_file = PATH_LOCALE.$settings['locale']."/".$nameparts[1].".php"; … … 141 142 default: 142 143 // unknown module type 144 trigger_error("ExiteCMS locales error: unknown or invalid module type specified in ".$locale_name."!", E_USER_ERROR); 143 145 } 144 146 } 145 147 146 // if a locales file could be assembled, and it exists, load it 147 if (!empty($locales_file) && file_exists($locales_file)) { 148 include $locales_file; 148 // if a locales file could be assembled... 149 if (!empty($locales_file)) { 150 if (file_exists($locales_file)) { 151 // and it exists, load it 152 require_once $locales_file; 153 } else { 154 // otherwise, if the locale is not English, try to load the English version 155 if ($settings['locale'] != "English") { 156 $current_locale = $settings['locale']; 157 $settings['locale'] = "English"; 158 locale_load($locale_name); 159 $settings['locale'] = $current_locale; 160 } else { 161 trigger_error("ExiteCMS locales error: unable to locate a locale for ".$locale_name."!", E_USER_ERROR); 162 } 163 } 149 164 } 150 165
Note: See TracChangeset
for help on using the changeset viewer.
