Permalink
Browse files

use CakeSession wrapper

  • Loading branch information...
1 parent 5870d71 commit c3e501b2d939f885c525b34e1a123023ab101f3b @dereuromark dereuromark committed Nov 26, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/Cake/I18n/I18n.php
@@ -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 @@ 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 c3e501b

Please sign in to comment.