Minver
Minver

Reputation: 54

Best approach for rails 3 I18n

I have a page with brands, tags, comments and products. It's time to go international and I have some question about how to setup the I18n.

I have read some about Internalization and even tried the globalize gem 1 year ago but it's still lot of things I don't know how do handle. I translate the static text on my webpage using the beautiful I18n.translate() method storing every static and semi-static text in a different .yml file. The problem comes when try to keep track of relations depending on language.

Before getting into the problem I show you my database-schema/models. Notice that none of the models has the locale variable yet.


Models and schema


Product

belongs_to :category
has_many :taggings
has_many :tags, :through => :taggings
has_many :comments

Comment

belongs_to :product, :counter_cache => true

Brand

has_many :products

Tagging

belongs_to :tag
belongs_to :product

Tag

has_many :taggings
has_many :products, :through => :taggings

Problems


I need advise from someone who know how to handle I18n applications well and the question is simple: how do I solve the problems above? All answers are appreciated.

Upvotes: 3

Views: 2926

Answers (1)

Anton Kopylov
Anton Kopylov

Reputation: 135

I use puret http://github.com/jo/puret for translate data. Nice plugin works well, but I have some not yet solved problems when saving nested models with translated fields.

Other alternatives not working with Rails 3 now.

Upvotes: 1

Related Questions