Skip to content

Commit

Permalink
Fixed issue: survey language not initiated in session
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 14, 2016
1 parent 2b72e71 commit 573d104
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/core/LSYii_Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public function initLanguage()
{
$this->setLanguage($this->request->getParam('lang'));
}
elseif (isset(App()->session['_lang'])) // See: http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/
{
$this->setLanguage(App()->session['_lang']);
}

}
/**
Expand Down Expand Up @@ -182,6 +186,7 @@ public function setLanguage( $sLanguage )
{
$sLanguage=preg_replace('/[^a-z0-9-]/i', '', $sLanguage);
$this->messages->catalog = $sLanguage;
App()->session['_lang'] = $sLanguage; // See: http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/
parent::setLanguage($sLanguage);
}

Expand Down

0 comments on commit 573d104

Please sign in to comment.