Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- App::uses('Controller', 'Controller');
- App::import('I18n', 'l10n');
- class AppController extends Controller {
- public $helpers = array('Html', 'Form');
- public function getLanguage() {
- return Configure::read('Config.language');
- }
- public function _setFrench() {
- Configure::write('Config.language', "fra");
- $this -> Session -> write('Config.language', 'fra');
- $this -> set('lang', $this -> getLanguage());
- }
- public function beforeFilter() {
- $this -> L10n = new L10n();
- $this -> L10n -> languagePath = array('fra');
- $this -> L10n -> locale = 'fra';
- $setting = $this -> L10n -> get("fra");
- $this -> L10n -> get();
- $this -> set('domain', 'default');
- Configure::write('Config.language', "fra");
- $this -> Session -> write('Config.language', 'fra');
- $this -> set('lang', $this -> getLanguage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement