let's say I have the model 'Pages' that has :name, :content, :title ...etc
one of my requirements is that each of those attributes needs to be in 3 languages, and since those pages are to be stored in the db, using flat i18n files is out of the question
my solution in the past was to use a two tables and a join:
pages:
id name
pages_meta:
page_id title content language_id
in plain SQL i would be selecting:
SELECT * FROM pages p LEFT JOIN pages_meta pm ON p.id = pm.page_id
WHERE language_id = (server_variable for current language)
how I can achieve that in model in either rails or fuelphp (I'm using fuelphp for this project and rails for a different one but the issue is the same, and I'm not asking about how to code it, just how i would go about achieving this, or I would have to not use the orm and just go with plain SQL ?)
I can use the many_to_many or has_many relationships, but I think that will introduce complexity dealing with each model as many since it's all the same data at the end
EDIT : ORM => Object Relational-Mapping, FuelPHP is the name of an HMVC library in PHP
EDIT 2 :
FuelPHP ORM database schema for i18n, opinions/suggestions
I'm fully aware of this related question, however the three solutions he's suggesting, aren't exactly what I'm looking for, I'm looking for a way to store data in different tables, and handle them as the same model, even tho I'm primarily interested in language, there are other cases in which I want the data separated
also for rails there is a gem called globalize that can i18n-ize the fields of an ORM model, but still not using different tables