I want users to choose their language in a cakePHP app. I have default.po files for German and English. But when I call $this->Session->write('Config.language', 'ger'); in a Controller function, nothing happens.
What do I have to do to make it work?
Controller function:
public function changeLang() {
$this->autoRender = false;
$this->Session->write('Config.language','ger');
Configure::write('Config.language','ger');
$this->Session->setFlash(__('Language changed succefully.'));
$this->redirect($this->referer());
}
I found the solution, i used the wrong language-code for my folder. I had “ger” but it should have been “deu”.