views:

153

answers:

1

I'm writing in Rails a website that will be multilingual, for the application translation part i will use the simple I18n gem, for messages and everything related.

Yet, all the content must be translated, and we're talking about lots of pages, that will be stored into the database ( like articles, news, etc. )

For now, I'm thinking of two approaches:

1.Lets say i have a Pages table, the content in diff. languages, i will be storing it in a different table called PagesContent that will belong_to Pages and also to a Languages table.

The problem here, is that I'll essentially duplicate the no. of tables needed. Pros: flexibility, in the box validation

2.To skip that duplication i can serialize a hash into the content column of Pages, containing the translation.

The problem here, is validation, arguably more code to write, and less flexibility when adding a new language. Pros: Less tables.

Any other idea ?

+1  A: 

What about using globalize2? It's a gem designed to make all of that easier.

Tony Fontenot
looks like a good solution if you don't want to code it yourself, in the end I've made my own process for translating everything
dakull