]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/plugins/SyjLocale.php
store lang preference in session instead of url
[syj.git] / application / controllers / plugins / SyjLocale.php
index 19af8ec77e5409e7985f9dca0e260e95699f99ac..52dd4919718437fed82586702fea902a25c6cbb0 100644 (file)
@@ -7,11 +7,14 @@ class Syj_Controllers_Plugins_SyjLocale extends Zend_Controller_Plugin_Abstract
 
     public function preDispatch(Zend_Controller_Request_Abstract $request) {
         $lang = $request->getQuery('lang');
-        if (is_null($lang)) {
-            return;
+
+        if ($lang) {
+            setcookie("syj_lang", $lang, 0, "", "", false, true);
+        } else {
+            $lang = $request->getCookie('syj_lang');
         }
 
-        if (!Zend_Registry::isRegistered('Zend_Translate')) {
+        if (!$lang) {
             return;
         }