views:

341

answers:

2

I'm using Translate behavior.

Here's the scenario: I save a translation on model 'Content' with the language Japanese.

Then I check the corresponding table 'contents' in my database and I see that my 'title' and 'body' fields are changed to the translated inputs (in Japanese). My English (and Japanese) content is saved in the content_i18ns table.

Everything in my views is still in English so it's all fine. I'm just concerned why my 'contents' table is updated with the translated input. It's just scary that it might cause errors in the future.

Is this ok? Am I doing something wrong or is this a normal behavior with CakePHP?

Thanks in advance!

A: 

Hi, Drop fields 'title' and 'body' from Your 'contents' table:)

kicaj
Is that a proper solution? I'm thinking about making CakePHP not update the 'Content' table with the latest translated input.
+1  A: 

Hey!

It is normal.

Everything that you save will get saved in the contents table in the language you are currently using on the page. + it will get saved in the i18n table.

It won't cause any problems, you won't loose data, and if you use the Translate behavior according to the (cook)book than your pages will be fetched in the correct language (since the results will be fetched making a join of the tables contents and i18n (or the custom table that you have defined) and the data fields will be updated corresponding to the language you have set).

matyas
wow thanks for the time in answering my question. i'm relieved that somehow someone else thinks it's okay :)

related questions