2008/2/14, r0sk <[EMAIL PROTECTED]>: > > Hi people: > > I'm now trying to add i18n on a webapp but I dunno how's the right use of > Translate Behavior. I'd seen that the new CookBook had i18n and I would be > pleased to see the code. Anyone knows if there is a SVN/Trac or so to see > how it works. > > Thanks >
Does Translate behavior create a new general entry for each translation? I try to insert two translations in a loop (changing model->locale) and get two general entries in the main table and two translation entries in i18n table: class Prueba extends AppModel { var $name = 'Prueba'; var $actsAs = array('Translate' => array('title', 'content')); } function admin_add($lang = null) { if (!empty($this->data)) { $this->Prueba->create(); $languages = array('spa', 'eng', 'por', 'gal', 'ped'); foreach($languages as $v) { $data = array('title' => 'A title', 'content' => 'A Content'); $this->Prueba->create($data); $this->Prueba->locale=$v; $this->Prueba->save($data); $id = $this->Prueba->id; } } } Any tip? -- http://www.userlinux.net http://7throot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---