Skip to content

Commit

Permalink
Readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
dalpo committed Sep 18, 2011
1 parent fcd0b4d commit 796487b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ Or as a plugin:

First create your model:

script/generate model books title:string title_fr:string title_de:string author:string
rails g model book title:string description:text

Then specify which fields need to be internationalized in your model:

class Country < ActiveRecord::Base
has_foreign_language :title
has_foreign_language :title, :description
end

Finally generate a migration with internationalized fields:

Sintax:
rails g has_foreign_language <language> [Model]

Example:
rails g has_foreign_language it


Now let's create a book in the console and see how this works:

I18n.default_locale = "en"
Expand Down

0 comments on commit 796487b

Please sign in to comment.