Saturday, December 1, 2012

Translate behaviour / Save multiple languages at once

Hi

Ive searched for several hours now and unfortunatly the translate behaviour does not work as expected. I try to save multiple translation fields at once like so:

echo $this->Form->adminText('name.deu',__('Name german'));
echo $this->Form->adminText('name.eng',__('Name english'));

 My controller (save)action is unmodified from the one baked. In the model Ive correctly included the translate behaviour:

public $actsAs = array('Translate' => array('name'));

Cake-Version is 2.2.3

So what happens? I expect that the two name fields would be saved to the i18n table under their corresponding langauge after transmitting the form. But instead of this only the (actual) language stored in the session will be used...so only one language-entry is added to the i18n table and the other language will be completly ignored.

After searching the net several people had success with the approach shown above, but on my side it doesn't work. What I am doing wrong? Is this a bug?

Thank you for your help.

Greetings,
Frank

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: