Sha256: 9b19c383c6622d57424740ed9d5ea0d401f444ef4d5216064a14dfce2fd4258b

Contents?: true

Size: 1.85 KB

Versions: 2

Compression:

Stored size: 1.85 KB

Contents

= I18n generators

This gem plugin generates a set of locale files for Rails i18n feature. Supports Rails 4.0, 3.2.x, 3.1.x, 3.0.x, 2.3.x and 2.2.x.

* http://github.com/amatsuda/i18n_generators
* http://rubygems.org/gems/i18n_generators


== FEATURES

This gem/plugin provides following generate commands.

=== 1. Generate Locale Files for ActiveRecord/ActiveSupport/ActionPack

% rails g i18n_locale ja (de-AT, pt-BR, etc.)

Downloads the .yml file for the specified locale from the official rails-i18n repository:
    https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale

Then the generater sets the application default locale to the specified locale.

This will generate following locale file.

    config/locales/ja.yml

=== 2. Generate Translation YAML File For All Models/Attributes

% rails g i18n_translation ja (de-AT, pt-BR, etc.)

This will generate following YAML file.

    config/locales/translation_ja.yml

The generator scans your app/models directory, and generates a YAML file with all the AR model names and attributes so that you don't have to write the YAML skeleton manually or by copy/paste.
In addition, the generator tries to translate each of them into the specified language.
The generator doesn't overwrite the existing value so that you can rerun the generator again and again.

=== 3. Generate All

% rails g i18n ja (de-AT, pt-BR, etc.)

Executes 1 and 2 at once.


== REQUIREMENTS:

* Ruby 1.8.7, 1.9, 2.0
* Ruby on Rails 4.0, 3.2, 3.1, 3.0
* Ruby on Rails 2.3, 2.2 (supported by i18n_generators < 1.2)


== INSTALL:

* Rails 3 (with Bundler)

Add 'i18n_generators' to your Gemfile, then `bundle`. Restricting the group to :development would be a good idea, since the generator would probably be used only in development mode.

* Rails 2

Use 'i18n_generators' version '< 1.2'.


Copyright (c) 2008 Akira Matsuda, released under the MIT license

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n_generators-1.2.1 README.rdoc
i18n_generators-1.2.0 README.rdoc