0

currently i have an zend application with translation plugin as below

class Zc_Controller_Plugin_LangSelector extends Zend_Controller_Plugin_Abstract
{



public function preDispatch(Zend_Controller_Request_Abstract $req)
{

    $lang = $req->getParam('lang','');

    if($lang !== 'en' && $lang !== 'de')
        $req->setParam('lang','en');

    $state = $req->getParam('state');

    $lang = $req->getParam('lang');
    if($lang == 'en')



    $zl = new Zend_Locale();
    $zl->setLocale($locale);
    Zend_Registry::set('Zend_Locale',$zl);

    $translate = new Zend_Translate('csv',APPLICATION_PATH.'/configs/lang/'.$lang.'.csv',$lang);

    Zend_Registry::set('Zend_Translate',$translate);


}
  }

also i have enabled plugin in application.ini as follow

resources.frontController.plugins.DetectCountry =    
       "Zc_Controller_Plugin_LangSelector"

i have created a folder name lang and inside i have create another 2 file named en.csv and fr.csv. Currently the translation is read from the .csv file, but i would to have the translation to read/write from db, so that i can administer to add/delete new key value fields directly from db.Thanks

d3bug3r
  • 2,492
  • 3
  • 34
  • 74
  • This is a very similar question and might help you: http://stackoverflow.com/a/2995843/532495 A Zend Solution will be available in 2.0 ... so maybe never: http://www.mail-archive.com/fw-general@lists.zend.com/msg12698.html – Andresch Serj Jul 25 '12 at 10:11
  • that site is not helping much... – d3bug3r Jul 25 '12 at 10:17
  • Why not? It is answering your question: There is no Zend_Translate_Adapter_Db yet, but you can write one yourself, it ain't that hard to do. Of course, a website offering a Db adapter would be better, but i guess that doesn't exist :( – Andresch Serj Jul 26 '12 at 08:29

0 Answers0