ActiveRecord: localized content, how?

4 views
Skip to first unread message

giorgian

unread,
Nov 23, 2009, 8:27:14 AM11/23/09
to Castle Project Users
Hi,

I have to keep some localized data; instead of keeping one
localization table for each project table, like local_products,
local_categories and so on, I'd like to just have one local_strings
table, with fields string_id, locale_name, text, and to replace
strings with ids in all other tables, with queries like this:

select products.id, ls1.text as name, ls2.text as description
from products, local_strings ls1, local_strings ls2
where ls1.string_id = products.name_id AND ls2.string_id =
products.description_id and ls1.locale = 'en' and ls2.locale = 'en';

Is this feasible with Castle.ActiveRecord (and, if so, how)?

Thanks
Reply all
Reply to author
Forward
0 new messages