This gem creates locale file from model attributes.
Add this line to your application's Gemfile:
gem 'model_to_locale'
And then execute:
$ bundle
Or install it yourself as:
$ gem install model_to_locale
Create a new locale file
rails g model_to_locale:create tr
models.tr.yml
file created.
---
tr:
activerecord:
models:
profile: Profile
group: Group
attributes:
profile:
id: Id
first_name: First_name
last_name: Last_name
gsm: Gsm
birthday: Birthday
user_id: User_id
created_at: Created_at
updated_at: Updated_at
group:
id: Id
number: Number
name: Name
domain_id: Domain_id
created_at: Created_at
updated_at: Updated_at
Add model attributes to locale file
rails g model_to_locale:add_model tr --model City
City
model attributes added to models.tr.yml
.
---
tr:
activerecord:
models:
profile: Profile
group: Group
city: City
attributes:
profile:
id: Id
first_name: First_name
last_name: Last_name
gsm: Gsm
birthday: Birthday
user_id: User_id
created_at: Created_at
updated_at: Updated_at
group:
id: Id
number: Number
name: Name
domain_id: Domain_id
created_at: Created_at
updated_at: Updated_at
city:
id: Id
name: Name
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request