I'm using Translate behavior.
Here's the scenario: I save a translation on model 'Content' with the language J开发者_如何学Capanese.
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!
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).
Drop fields 'title' and 'body' from Your 'contents' table:)
精彩评论