Provides convenience methods for setting/getting I18n specific fields.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.rvmrc
Gemfile
LICENSE.txt
README.md
Rakefile
has_translatable_attributes.gemspec

README.md

HasTranslatableAttributes

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'has_translatable_attributes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install has_translatable_attributes

Usage

# Assume fields :content_en, :content_es
class BlogPost < ActiveRecord::Base
  has_translatable_attributes
end

bp = BlogPost.new(...)

I18n.locale = :en
bp.content == bp.content_en
bp.content = "Enlish"
bp.content_en == "English"

I18n.locale = :es
bp.content == bp.content_es
bp.content = "Spanish"
bp.content_es == "Spanish"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request