https://github.com/richardvenneman/rails_admin_json_translate
:books: Integrate json_translate into rails_admin
https://github.com/richardvenneman/rails_admin_json_translate
admin i18n json jsonb rails rails-admin ruby
Last synced: about 1 year ago
JSON representation
:books: Integrate json_translate into rails_admin
- Host: GitHub
- URL: https://github.com/richardvenneman/rails_admin_json_translate
- Owner: richardvenneman
- License: mit
- Created: 2017-03-12T15:33:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-15T15:15:32.000Z (over 6 years ago)
- Last Synced: 2025-03-24T04:43:39.035Z (over 1 year ago)
- Topics: admin, i18n, json, jsonb, rails, rails-admin, ruby
- Language: Ruby
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# RailsAdminJsonTranslate
This gem integrates [json_translate](https://github.com/cfabianski/json_translate) into [rails_admin](https://github.com/sferik/rails_admin). It aims to provide a reasonably good interface for managing translations. It does so by grouping translations into a tabbed interface, having full language names and accompanying [country flags](https://github.com/richardvenneman/emoji_flag) allowing for good scannability.
[](https://travis-ci.org/richardvenneman/rails_admin_json_translate)
[](https://rubygems.org/gems/rails_admin_json_translate)

## Usage
First make sure you've setup [json_translate](https://github.com/cfabianski/json_translate) for your models. You'll then need update your rails_admin configuration:
```ruby
RailsAdmin.config do |config|
...
config.model 'Post' do
configure :title_translations, :json_translate
# Overriding locales
configure :body_translations, :json_translate do
locales [:nl, :zh]
end
end
end
```
By default, rails_admin_json_translate uses the `I18n.available_locales` locales to create the tabbed interface. However you can specify the locales to use on a per-field basis as shown above.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rails_admin_json_translate'
```
And then execute:
```bash
$ bundle
```
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).