Re: Some doubts with Dynamic Content Localization

2008-03-06 Thread ninjapiza

Hi,
What's your question about your doubt is with associated models ?

On 26 fév, 13:34, Fran Iglesias [EMAIL PROTECTED] wrote:
 Hi,

 I'm trying to implement dynamic content localization in one project
 usingtranslatebehavior and the i18n table.

 One doubt is withassociatedmodels. Looking at theTranslate
 behavior code seems that at least hasMany associations could be
 managed by the behavior itself, but it's no clear to me how to
 achieve this in theactsAsarrayof the model. How to specify the
 field and FieldAssoc.

 Another bit confusing me after reading some tutorials is how to set a
 default language for the behavior. I mean: is there a CakePHP setting
 for this or you must set one of your own?.

 Thanks.

 --
 Fran Iglesias
 [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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@googlegroups.com
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
-~--~~~~--~~--~--~---



translate behavior and association model

2008-03-06 Thread ninjapiza

Hi,
I can't save my data in two locale.

I explain :
I use this translate behavior in my Post Model, in association with
Product Model:

class Post extends AppModel
{
var $name = 'Post';
var $actsAs = array('Translate' = array(
'body' = 'TranslationPostBody'));

var $hasMany = array('Comment' =
array(
'className' = 'Comment',
'foreignKey'= 'post_id'
));
}

class Product extends AppModel
{
var $name = 'Product';
var $hasOne = array(
'Post' =
array('className'= 'Post',
'conditions'   = '',
'order'= '',
'dependent'=  true,
'foreignKey'   = 'product_id')
);
}

In my ProductsController class, I use the following code to save my
data :
if (!$this-Product-Post-save($this-data)) {
$this-flash('Echec de sauvegarde du 
post','/products');
$error = true;
}
It works the first time, for instance when a use 'fre' locale. Data
are well stored in database, in i18N table.
The next time, I use 'eng' locale and It does not save my post. Why ?
I do not know how to debug this.

An idea ?

--~--~-~--~~~---~--~~
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@googlegroups.com
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
-~--~~~~--~~--~--~---