Changeset 841 for trunk/includes/Locale.php
- Timestamp:
- Jan 12, 2016, 10:33:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/Locale.php
r840 r841 162 162 var $Codes; 163 163 var $Dir; 164 var $LangCode; 165 var $DefaultLangCode; 166 var $Available; 164 167 165 168 function __construct(System $System) … … 168 171 $this->Codes = array('en'); 169 172 $this->CurrentLocale = new LocaleFile($System); 173 $this->LangCode = 'en'; 174 $this->DefaultLangCode = 'en'; 175 $this->Available = array(); 170 176 } 171 177 … … 218 224 function LoadLocale($Code) 219 225 { 220 $this->CurrentLocale->Dir = $this->Dir; 221 $this->CurrentLocale->Load($Code); 226 if(array_key_exists($Code, $this->Available)) 227 { 228 $this->CurrentLocale->Dir = $this->Dir; 229 $this->CurrentLocale->Load($Code); 230 } else throw new Exception('Unsupported locale code '.$Code); 222 231 } 223 232 } … … 226 235 function T($Text) 227 236 { 228 global $ LocaleManager;229 230 if(isset($ LocaleManager)) return($LocaleManager->CurrentLocale->Texts->Translate($Text));237 global $GlobalLocaleManager; 238 239 if(isset($GlobalLocaleManager)) return($GlobalLocaleManager->CurrentLocale->Texts->Translate($Text)); 231 240 else return($Text); 232 241 }
Note:
See TracChangeset
for help on using the changeset viewer.