Re: translation again: add new on update with translate behavior

2007-09-27 Thread jcsiegrist
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 > th

Re: translation again: add new on update with translate behavior

2007-09-27 Thread jcsiegrist
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 it

Re: translation again: add new on update with translate behavior

2007-09-26 Thread bunyan
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

Re: translation again: add new on update with translate behavior

2007-09-25 Thread cakeFreak
Wow jcsiegrist, it works! So far I have a basic example for it: - CONTROLLER sections_controller.php (partial) - function add() { if (!empty($this->data)) {

Re: translation again: add new on update with translate behavior

2007-09-25 Thread cakeFreak
Cheers jcsiegrist, I'll play around with it! If/when you have time an example usage is appreciated (I guess I should use your functions in beforeSave, afterSave etc conditions). Dan On 25 Set, 14:29, jcsiegrist <[EMAIL PROTECTED]> wrote: > Hi, > > on a project I use a custom behavior that ex

Re: translation again: add new on update with translate behavior

2007-09-25 Thread jcsiegrist
Hi, on a project I use a custom behavior that extended the existing translate behaviort. This setup lets me add Translations to any model. I don't have the time to fully explain what I did right now and how to use it, but maybe it gives you some ideas or a starting point. http://bin.cakephp.org/

Re: translation again: add new on update with translate behavior

2007-09-24 Thread cakeFreak
Is the right way to write a controller function that acts directly and only on the i18n tables? Dan --~--~-~--~~~---~--~~ 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@go

Re: translation again: add new on update with translate behavior

2007-09-24 Thread cakeFreak
Hey guys, well, I have to actions: ADD and EDIT. Eventually we can write a specific one: ADD_TRANSLATION Everything works fine if I maniulate the database entries manually after adding the first record. Namely I put the same id in table i18n "row_id": ---

Re: translation again: add new on update with translate behavior

2007-09-24 Thread [EMAIL PROTECTED]
Guys, I may be just glazing over something that will happen auto- magically, and if so please correct me. It sounds like what you have are two different actions: action one (add) -> generates your entry, a regular save, with the i18l stuff thrown in. action two (translation) -> updates your ent

Re: translation again: add new on update with translate behavior

2007-09-24 Thread bunyan
I'm also interested. That's what I was asking for here: http://groups.google.co.uk/group/cake-php/browse_thread/thread/76a10e3d2fb75e7b/572e4d55d86c27d0#572e4d55d86c27d0 On 25 Sep, 08:30, cakeFreak <[EMAIL PROTECTED]> wrote: > Hey guys I read a long post about i18n and translations. > > Neverthel

translation again: add new on update with translate behavior

2007-09-24 Thread cakeFreak
Hey guys I read a long post about i18n and translations. Nevertheless, I did not find an answer to my problem yet. http://groups.google.com/group/cake-php/browse_frm/thread/889c63d32cfdf69/877ac273611da97e?lnk=gst&q=i18n&rnum=1#877ac273611da97e Summarizing: 1) The translate behavior works fine