<commit_before># RailsAdminGlobalizeField

  RailsAdminGlobalizeField adds tabbed interface to [rails_admin](https://github.com/sferik/rails_admin) for multilingual models (using [globalize3](https://github.com/svenfuchs/globalize3) gem)

  It creates custom field type for globalize3 translations that you can use on any translations asssociation to translated models.

  This gem uses Translation models generated by globalize3, so you don't need to add any additional models to your project (as some older globalize3 gists suggested).

## Installation

> rails-4.0 compatible only for now!

Add and configure globalize3 gem first. **You need to use rails4 branch.**
``` ruby
  gem 'paper_trail', github: 'airblade/paper_trail'
  gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
```


Add this line to your application's Gemfile:
``` ruby
    gem 'rails_admin_globalize_field'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails_admin_globalize_field

## Usage

Add `accepts_nested_attributes_for` for translations to your **translated** model
``` ruby
  class Model < ActiveRecord::Base
    translates :title, :desc
    accepts_nested_attributes_for :translations, :allow_destroy => true
  end
```

Add configuration to associated **translation** model:
``` ruby
  config.model 'Model::Translation' do
    configure :locale, :hidden
    include_fields :locale, :title, :desc
  end
```
`:locale` field is always required.

<commit_msg>Add remark about including translation model to README<commit_after># RailsAdminGlobalizeField

  RailsAdminGlobalizeField adds tabbed interface to [rails_admin](https://github.com/sferik/rails_admin) for multilingual models (using [globalize3](https://github.com/svenfuchs/globalize3) gem)

  It creates custom field type for globalize3 translations that you can use on any translations asssociation to translated models.

  This gem uses Translation models generated by globalize3, so you don't need to add any additional models to your project (as some older globalize3 gists suggested).

## Installation

> rails-4.0 compatible only for now!

Add and configure globalize3 gem first. **You need to use rails4 branch.**
``` ruby
  gem 'paper_trail', github: 'airblade/paper_trail'
  gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
```


Add this line to your application's Gemfile:
``` ruby
    gem 'rails_admin_globalize_field'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails_admin_globalize_field

## Usage

Add **translation** models to `config.included_models` in `initializers/rails_admin.rb`:
``` ruby
  config.included_models = ['Model','Model::Translation']
```

Add `accepts_nested_attributes_for` for translations to your **translated** model
``` ruby
  class Model < ActiveRecord::Base
    translates :title, :desc
    accepts_nested_attributes_for :translations, :allow_destroy => true
  end
```

Add configuration to associated **translation** model:
``` ruby
  config.model 'Model::Translation' do
    configure :locale, :hidden
    include_fields :locale, :title, :desc
  end
```
`:locale` field is always required.


{'fraction_non_alphanumeric': 0.0937892095357591, 'fraction_numerical': 0.0075282308657465494, 'mean_word_length': 5.016981132075472, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5462721', 'n_tokens_mistral': 984, 'n_tokens_neox': 895, 'n_words': 325}