Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

localeapp/translates_fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translates_fields

Build status

Provides a way of storing and retreiving tranlsation keys and options in your ActiveRecord models.

Installation

Add gem 'translates_fields' to your Gemfile and run bundle install.

Use

Your model must have a text column defined.

class Address < ActiveRecord::Base
  translates :country
end

You then assign a translation key for your instances.

address = Address.new(:country => :france)
puts address.country 
# => This is the same as calling I18n.translate(:'models.address.attributes.country.france')

Compatibility

  • ruby 1.9.2
  • rails 3+

About

Lets you set and retrieve translation keys in your ActiveRecord models

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages