Permalink
Browse files

Merge pull request #975 from dereuromark/2.3-i18n

use CakeSession wrapper in i18n class
  • Loading branch information...
2 parents 7f0085c + c3e501b commit 0230fa102a61873888abef01051ad1599413cc4c @markstory markstory committed Nov 29, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/Cake/I18n/I18n.php
View
@@ -20,6 +20,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.
@@ -144,9 +145,10 @@ public static function translate($singular, $plural = null, $domain = null, $cat
}
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');
}
}

0 comments on commit 0230fa1

Please sign in to comment.