2 /* This file is part of Syj, Copyright (c) 2010 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');
14 if (!Zend_Registry::isRegistered('Zend_Translate')) {
18 $translator = Zend_Registry::get('Zend_Translate');
19 $adapter = $translator->getAdapter();
20 if (!$adapter->isAvailable($lang)) {
24 $adapter->setLocale($lang);