Forgot to add: The actual translated data is just saved regularly, as the cake translate behavior takes care of it, because the model- >locale is set appropriately.
On Sep 27, 8:45 am, jcsiegrist <[EMAIL PROTECTED]> wrote: > Hmm, the method createTranslations is actually used before I get to > the view to enter the translation data. I needed to have a translation > of every translatable field, even if the data was empty, this was to > check for available translations of a record later on -- the translate > behavior creates its data rows per field, not per record. > > I also set the model->locale to the desired locale I'm adding editing > on. I use a component (http://bin.cakephp.org/view/1655477759). The > initLocale method is called from the controller. The views have > conditional rendering of interface elements based on special value of > $locale 'choose', to present a popup of available languages I want to > translate to. it returns the chosen locale in the data with the key > 'newlocale', which > > :jc > > On Sep 27, 6:36 am, bunyan <[EMAIL PROTECTED]> wrote: > > > jcsiegrist, thanks for code! > > > The line #34 looks strange: > > > $this->_model->Content->save(array('I18nContent' => array('content' => > > ''))); > > > It seems that it inserts a blank field into the table. How does it > > work then? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
