Sha256: ee448b607824ed11144b22f4abbe397ea2708ce82319f19b9f4bcda61764a400

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

sequel_translatable
===================

Translate model attributes for sequel.

Dependencies
------------

* Ruby >= 1.9.2
* gem "i18n"
* gem "sequel"

Usage
-----

* Declare translatable attribute inside your model:

        class MyModel < Sequel::Model
          plugin :translatable, :value
        end

* or for multiple attributes:

        class MyModel < Sequel::Model
          plugin :translatable, [:name, :value]
        end

* then:

        I18n.locale
        -> :en
        m = MyModel.new value_en: "Item", value_fr: "Objet"
        m.value
        -> "Item"
        I18n.locale = :fr
        m.value
        -> "Objet"
        I18n.locale = :en_master
        m.value
        -> "Item"
        m.value = "Object"
        m.all_values
        -> {en: "Object", fr: "Objet"}

Build Status
------------

[![Build Status](http://travis-ci.org/TalentBox/sequel_bitemporal.png)](http://travis-ci.org/TalentBox/sequel_translatable)

License
-------

sequel_translatable is Copyright © 2011 TalentBox SA. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sequel_translatable-0.2.0 README.md
sequel_translatable-0.1.0 README.md