Created
June 9, 2011 15:14
-
-
Save simi/1016938 to your computer and use it in GitHub Desktop.
Localize refinery engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First, you need to specify translated fields in your model | |
| # model.rb | |
| translates :text, :title | |
| # make translation migration (stolen from https://github.com/svenfuchs/globalize3) | |
| class CreatePosts < ActiveRecord::Migration | |
| def self.up | |
| Post.create_translation_table! :title => :string, :text => :text | |
| end | |
| def self.down | |
| Post.drop_translation_table! | |
| end | |
| end | |
| # use locale picker for your views | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment