Changeset 587 for trunk/app/app_controller.php
- Timestamp:
- 06/04/08 20:53:56 (6 months ago)
- Files:
-
- 1 modified
-
trunk/app/app_controller.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r541 r587 9 9 */ 10 10 //file: app_controller.php 11 12 uses('L10n'); 11 13 12 14 class AppController extends Controller { … … 25 27 $this->Auth->authorize = 'controller'; 26 28 $this->Auth->deny('*'); 29 30 //set locale 31 $this->__setLocale(); 27 32 } 28 33 … … 48 53 exit; 49 54 } 55 56 private function __setLocale() 57 { 58 $this->L10n = new L10n(); 59 /* $languages = array('es','en'); // 'nah' for nahuatl 60 $paramLang = strtok($_SERVER['HTTP_HOST'],'.'); 61 $lang = $this->Session->check('lang') ? $this->Session->read('lang'):'en'; 62 63 if (isset($paramLang) && in_array($paramLang,$languages) ): 64 $lang = $paramLang; 65 $this->Session->write('lang',$lang); 66 else: 67 $this->Session->write('lang',$lang); 68 endif; */ 69 $lang = 'es'; 70 $this->L10n->get($lang); 71 Configure::write('Config.language', $lang); 72 } 50 73 } 51 74 ?>
