Rails I18n translations with Database Backend
November 3, 2009 • Ruby on Rails • Comments
Rails Internationalization (I18n) API is a great way to start with multilanguage pages.
However, i found it quite horrible to specify my translations inside if the corresponding #lang.yml/.rb files etc.
After searching a bit, i found globalize2 – a nice plugin that creates localization-models for each model you want to translate.
quite all you have to add to your code is
1 2 3 | class Post < ActiveRecord::Base translates :title, :text #this over here end |
Quite nice, but: a new sql-request for each model you want to translate – that sucks!
[More]