views:

674

answers:

1

I'm slowly learning how to apply CakePHP's Translate Behavior and I think I've grasped the basics, but I'm working on an existing project with existing data. It's great that Cake will insert new records for me, but I need to manually (I assume) insert a few translations for some existing data. My first question:

Do I have to have a record in my i18n table for en_us if that's my default language and the language that's used in my core table? For example, if categories.name = 'Entertainment', do I really need to create a "duplicate" record in i18n to indicate to specify the English translation of "Entertainment"? Empirical evidence seems to say yes, but that seems like a lot of extra work so I'm hoping that someone can tell me that I'm missing something.

Second, is there an "easy" way to get translation records into the database? As languages are added over the course of a project, it's going to be really painful to go back and create i18n records for legacy data.

Thanks.

A: 

I don't have an answer for the second question, but the answer to the first seems to be "yes". After digging through the source code, it looks like the where clause of generated queries restricts the results to those where the field name being retrieved has a locale value for the current locale. That's pretty limiting.

There's an existing ticket for this (or something very similar to it).

Rob Wilkerson
And the answer to the second appears to be "no".
Rob Wilkerson