tags:

views:

46

answers:

2

Hi,

in cakebook on page http://book.cakephp.org/view/1331/Defining-the-Fields there is a sentence what I am not able interpret:

When defining fields for TranslateBehavior to translate, be sure to omit those fields from the translated model's schema. If you leave the fields in, there can be issues when retrieving data with fallback locales.

Can somebody explain me in a more simple way than it is in originally? I think I have language problem as english is not my native :P

A: 

I've never used that behaviour and I have to say that I would be looking elsewhere for an explanation of how to use it as I too (and I'm English) am having trouble understanding it.

My guess is that you need to ensure that there are no fields in the i18n table with the same name as a field that you are translating, i.e. if you are translating Post.name you must be careful not to have i18nTable.name

I don't use the console and there is no explanation of the required name or structure of the i18n table, so my comment is guesswork but I hope that it is in someway helpful.

Leo
A: 

It means that in the following case:

class Article extends AppModel
{
    var $actsAs = array('Translate' => array('title'));
}

You should not have the field Article.title (i.e. articles.title) in your database, otherwise you'll have trouble at some point.

Basically, when you design your table you plan to translate, omit those fields you want to translate.

Hope that helps!

dr Hannibal Lecter
thanks I supposed it but wasn't sure.
sipiatti