Forever i have been doing my translations in the same table where object/element is created.
So for example if i work with posts and title of post needs a translation i do this -> post_title_en
, post_title_fr
, post_title_nl
.
Well, this is quite terrible way to maintain application, you have to hard code in a lot of stuff in your code.
So i'm writing an application at the moment and i would like to break out of this bad habit to translate like this.
How would i approach translations if i don't know what kind of data length i have to hold in table fields?
I could have translation for post_title
witch typically would be varchar(255)
and i could have something like post_content
witch typically would be text
. And how would i reference all this with main object?
Any pointers are welcome. Thanks.