http://colorblindprogramming.com/multiple-languages-in-a-cakephp-2-application-in-5-steps
یه فسمت هایی از این لینک جالب نبود و تغییرش دادم
public function beforeFilter() {
$this -> _setLanguage();
}
private function _setLanguage() {
//if the user clicked the language URL
if (isset($this -> params['language']) && ($this -> params['language'] != $this -> Cookie -> read('lang'))) {
//then update the value in Session and the one in Cookie
$this -> Cookie -> write('lang', $this -> params['language'], false, '7 days');
}
//if the cookie was previously set, and Config.language has not been set
//write the Config.language with the value from the Cookie
else if ($this -> Cookie -> read('lang') ) {
$this -> params['language'] = $this -> Cookie -> read('lang') ;
}
}
http://book.cakephp.org/2.0/en/controllers/request-response.html
http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html