The project is in a healthy, maintained state
Model translations for ActiveRecord.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 7.0.0
 Project Readme

AwesomeModelTranslations

Short description and motivation.

Usage

Add a translated attribute to your model:

class Project < ApplicationRecord
  translates :name
end

You can set the name in the current locale like this:

I18n.locale = :en
project.name = "English name"
project.name #=> "English name"

Or set the name for a specific locale like this:

I18n.locale = :en
project.name_da = "Dansk navn"
project.name #=> "Dansk navn"

Installation

Add this line to your application's Gemfile:

gem "awesome_model_translations"

And then execute:

$ bundle

Or install it yourself as:

$ gem install awesome_model_translations

Install the migrations and run them:

rake railties:install:migrations
rails db:migrate

License

The gem is available as open source under the terms of the MIT License.