Module: I18nAdminUtils::Config
- Defined in:
- lib/i18n_admin_utils/config.rb
Class Attribute Summary collapse
-
.locales ⇒ Object
Returns the value of attribute locales.
-
.reload_translation_after_update ⇒ Object
Returns the value of attribute reload_translation_after_update.
-
.search_folders ⇒ Object
Returns the value of attribute search_folders.
-
.search_folders_exclude ⇒ Object
Returns the value of attribute search_folders_exclude.
-
.translation_model ⇒ Object
Returns the value of attribute translation_model.
-
.yml_file ⇒ Object
Returns the value of attribute yml_file.
Class Method Summary collapse
Class Attribute Details
.locales ⇒ Object
Returns the value of attribute locales.
8 9 10 |
# File 'lib/i18n_admin_utils/config.rb', line 8 def locales @locales end |
.reload_translation_after_update ⇒ Object
Returns the value of attribute reload_translation_after_update.
7 8 9 |
# File 'lib/i18n_admin_utils/config.rb', line 7 def reload_translation_after_update @reload_translation_after_update end |
.search_folders ⇒ Object
Returns the value of attribute search_folders.
9 10 11 |
# File 'lib/i18n_admin_utils/config.rb', line 9 def search_folders @search_folders end |
.search_folders_exclude ⇒ Object
Returns the value of attribute search_folders_exclude.
10 11 12 |
# File 'lib/i18n_admin_utils/config.rb', line 10 def search_folders_exclude @search_folders_exclude end |
.translation_model ⇒ Object
Returns the value of attribute translation_model.
6 7 8 |
# File 'lib/i18n_admin_utils/config.rb', line 6 def translation_model @translation_model end |
.yml_file ⇒ Object
Returns the value of attribute yml_file.
11 12 13 |
# File 'lib/i18n_admin_utils/config.rb', line 11 def yml_file @yml_file end |
Class Method Details
.backend ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/i18n_admin_utils/config.rb', line 42 def backend if @backend.nil? or @backend.blank? i18n_backend = I18n.backend.class.to_s if i18n_backend == 'I18n::Backend::Chain' #If the backend is a chain but no backend was specified then we take the first one i18n_backend = I18n.backend.backends.first.class.to_s end self.backend=i18n_backend end @backend end |
.backend=(i18n_backend) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/i18n_admin_utils/config.rb', line 32 def backend=(i18n_backend) if i18n_backend.to_s == 'I18n::Backend::ActiveRecord' @backend = I18nAdminUtils::Backend::ActiveRecordManager elsif i18n_backend.to_s == 'I18n::Backend::Simple' @backend = I18nAdminUtils::Backend::YmlManager else raise Exception, "I18nAdminUtils, backend #{i18n_backend} not supported!" end end |
.reset ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/i18n_admin_utils/config.rb', line 13 def reset @translation_model = 'Translation' @reload_translation_after_update = true @locales = ['en'] @search_folders = ["#{Rails.root}/app"] @search_folders_exclude = [] @yml_file = '' @backend = nil end |