Class: I18nAdmin::HstoreBackend
- Inherits:
-
I18n::Backend::KeyValue
- Object
- I18n::Backend::KeyValue
- I18nAdmin::HstoreBackend
- Defined in:
- lib/i18n_admin/hstore_backend.rb
Defined Under Namespace
Classes: Store
Instance Method Summary collapse
- #available_locales ⇒ Object
-
#initialize ⇒ HstoreBackend
constructor
A new instance of HstoreBackend.
- #store_translations(locale, data, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ HstoreBackend
Returns a new instance of HstoreBackend.
51 52 53 |
# File 'lib/i18n_admin/hstore_backend.rb', line 51 def initialize @store = HstoreBackend::Store.new end |
Instance Method Details
#available_locales ⇒ Object
5 6 7 |
# File 'lib/i18n_admin/hstore_backend.rb', line 5 def available_locales @available_locales ||= I18nAdmin::TranslationsSet.pluck(:locale) end |
#store_translations(locale, data, options = {}) ⇒ Object
55 56 57 58 59 |
# File 'lib/i18n_admin/hstore_backend.rb', line 55 def store_translations(locale, data, = {}) data.each do |key, value| store.store_translations(locale, key, value) end end |