<commit_before># Traco

[![Build Status](https://secure.travis-ci.org/barsoom/traco.png)](http://travis-ci.org/barsoom/traco)

Translatable attributes for Rails 3, stored in the model table itself.

Inspired by <NAME>'s [translatable_columns](https://github.com/iain/translatable_columns/).

To store translations outside the model, see Sven Fuchs' [globalize3](https://github.com/svenfuchs/globalize3).


## Usage

Say you want `Post#title` and `Post#body` to support both English and Swedish values.

Write a migration to get database columns with locale suffixes, e.g. `title_sv` and `title_en`, like:

```ruby
class CreatePosts < ActiveRecord::Migration
  def change
    create_table :posts do |t|
      t.string :title_sv, :title_en
      t.text :body_sv, :body_en

      t.timestamps
    end
  end
end
```<commit_msg>Mention Rails 4 in README.<commit_after># Traco

[![Build Status](https://secure.travis-ci.org/barsoom/traco.png)](http://travis-ci.org/barsoom/traco)

Translatable attributes for Rails 3 and 4 (Ruby 1.9+), stored in the model table itself.

Inspired by <NAME>'s [translatable_columns](https://github.com/iain/translatable_columns/).

To store translations outside the model, see Sven Fuchs' [globalize3](https://github.com/svenfuchs/globalize3).


## Usage

Say you want `Post#title` and `Post#body` to support both English and Swedish values.

Write a migration to get database columns with locale suffixes, e.g. `title_sv` and `title_en`, like:

```ruby
class CreatePosts < ActiveRecord::Migration
  def change
    create_table :posts do |t|
      t.string :title_sv, :title_en
      t.text :body_sv, :body_en

      t.timestamps
    end
  end
end
```
{'fraction_non_alphanumeric': 0.11985688729874776, 'fraction_numerical': 0.005963029218843173, 'mean_word_length': 4.260188087774295, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 6, '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': '5023174', 'n_tokens_mistral': 591, 'n_tokens_neox': 562, 'n_words': 164}