Monday, September 29, 2008

Re: Help with TranslateBehavior needed.

It is price for performance and as simple db query as possible.
If you need to know (with multiple preferred locales set) which
translatios are missed, you will have to bind hasMany associations for
translated fields, like

var $actsAs = array('Translate' => array(
'title' => 'Titles',
'abstract' => 'Abstracts',
'text' => 'Texts'
));

or

$this->Service->bindTranslation(array(
'title' => 'Titles',
'abstract' => 'Abstracts',
'text' => 'Texts'
), false);

and then explore returned data for these associations.

Better would be validate translated data before saving (to have all
fields translated, or saved with empty|default string), off course.
Fact that record with missed translation is not returned (when single
locale is set) is intended behavior.
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: