Skip to content

richardvenneman/rails_admin_json_translate

Repository files navigation

RailsAdminJsonTranslate

This gem integrates json_translate into 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 allowing for good scannability.

Travis Gem

screenshot

Usage

First make sure you've setup json_translate for your models. You'll then need update your rails_admin configuration:

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:

gem 'rails_admin_json_translate'

And then execute:

$ bundle

License

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