2 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_Controllers_Plugins_SyjLocale extends Zend_Controller_Plugin_Abstract
8 public function preDispatch(Zend_Controller_Request_Abstract $request) {
9 $lang = $request->getQuery('lang');
12 setcookie("syj_lang", $lang, 0, "", "", false, true);
14 $lang = $request->getCookie('syj_lang');
21 $translator = Zend_Registry::get('Zend_Translate');
22 $adapter = $translator->getAdapter();
23 if (!$adapter->isAvailable($lang)) {
27 $adapter->setLocale($lang);