> To get all the translations for all the languages is a nightmare.
Solution exists.
$this->Article->Behaviors->attach('Translate', array('title' =>
'Title'));
$article = $this->Article->find('first');
You'll get title for returned article in current locale, and also
result of 'hasMany Title' association without condition on locale
(therefore all existing titles of this article).
Another approach would be (using the same sql queries):
$this->Article->Behaviors->attach('Translate', array('title'));
$I18nModel =& $this->Article->translateModel();
$article = $this->Article->find('first');
$titles = $I18nModel->find('all', array(
'conditions' => array(
'model' => 'Article',
'foreign_key' => $article['Article']['id']
)
));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---