TODO: Write a gem description
Add this line to your application's Gemfile:
gem 'sellect-translate'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sellect-translate
Add migration table to your Application:
$ rails g sellect:translate:install
Install migration table:
$ rake db:migrate
For each class where columns require translation:
- Hook in ActiveRecord association
- Indicate which columns to translate using translate_fields method
class Product
has_many :translations, as: :translatable # set association
translate_fields :name, :description # identify translatable columns
endExample - Creating translations on translatable fields:
product.translations.create(locale: :fr, params: { name: 'funky', presentation: 'Funky' })## Contributing
1. Fork it ( https://github.com/[my-github-username]/sellect-translate/fork )
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 a new Pull Request