Sha256: 03a1694b49f94f5f099365c942d2ed7dd166a9c828757e39e741ebdc82c44ee2

Contents?: true

Size: 950 Bytes

Versions: 1

Compression:

Stored size: 950 Bytes

Contents

Transmating
===========

Transmating adds i18n information to Mongoid documents. Simply include
`Transmating::I18n` to your model classes which include
`Mongoid::Document`.

    class Person
      include Mongoid::Document
      include Transmating::I18n

      field :name
      field :organization
    end

`Transmating::I18n` adds a simple `embeds_many` relationship to your
models, which is placeholder for translated attributes. You can
translate your models with calling `Transmating::I18n#translate` method
as presented below.

    # Translate your model objects
    p = Person.find_by_name("Yuna Kim")
    p.translate("ko", :name => "김연아", :organization => "고려대")

After translation, you can utilize it by calling
`Transmating::I18n#translated` method.

    <!-- Present translated attributes in your views -->
    안녕하세요! <%= @person.translated("ko").name %>님!

That's it. Feel free to fork and add your own features!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transmating-0.1.0 README.md