Skip to content

Instantly share code, notes, and snippets.

@simi
Created June 9, 2011 15:14
Show Gist options
  • Select an option

  • Save simi/1016938 to your computer and use it in GitHub Desktop.

Select an option

Save simi/1016938 to your computer and use it in GitHub Desktop.
Localize refinery engine
# 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