mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
use CakeSession wrapper
This commit is contained in:
parent
5870d71e84
commit
c3e501b2d9
1 changed files with 5 additions and 3 deletions
|
@ -23,6 +23,7 @@
|
|||
App::uses('CakePlugin', 'Core');
|
||||
App::uses('L10n', 'I18n');
|
||||
App::uses('Multibyte', 'I18n');
|
||||
App::uses('CakeSession', 'Model/Datasource');
|
||||
|
||||
/**
|
||||
* I18n handles translation of Text and time format strings.
|
||||
|
@ -142,9 +143,10 @@ class I18n {
|
|||
}
|
||||
|
||||
if (empty($language)) {
|
||||
if (!empty($_SESSION['Config']['language'])) {
|
||||
$language = $_SESSION['Config']['language'];
|
||||
} else {
|
||||
if (CakeSession::started()) {
|
||||
$language = CakeSession::read('Config.language');
|
||||
}
|
||||
if (empty($language)) {
|
||||
$language = Configure::read('Config.language');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue