Class: RailsI18nOnair::Configuration
- Inherits:
-
Object
- Object
- RailsI18nOnair::Configuration
- Defined in:
- lib/rails_i18n_onair/configuration.rb
Constant Summary collapse
- VALID_STORAGE_MODES =
Storage modes: :database - Use database (translations table) for storing translations :file - Use local YAML files from the Rails app
[:database, :file].freeze
Instance Attribute Summary collapse
-
#cache_translations ⇒ Object
Returns the value of attribute cache_translations.
-
#lazy_load_locales ⇒ Object
Returns the value of attribute lazy_load_locales.
-
#live_ui ⇒ Object
Returns the value of attribute live_ui.
-
#locale_files_path ⇒ Object
Returns the value of attribute locale_files_path.
-
#storage_mode ⇒ Object
Returns the value of attribute storage_mode.
Instance Method Summary collapse
- #database_mode? ⇒ Boolean
- #file_mode? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #live_ui? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 |
# File 'lib/rails_i18n_onair/configuration.rb', line 10 def initialize @storage_mode = :file # Default to file mode @locale_files_path = "config/locales" # Default Rails locale path @cache_translations = true # Enable caching by default @lazy_load_locales = true # Lazy load locales on-demand @live_ui = false # Live UI inline editing disabled by default end |
Instance Attribute Details
#cache_translations ⇒ Object
Returns the value of attribute cache_translations.
3 4 5 |
# File 'lib/rails_i18n_onair/configuration.rb', line 3 def cache_translations @cache_translations end |
#lazy_load_locales ⇒ Object
Returns the value of attribute lazy_load_locales.
3 4 5 |
# File 'lib/rails_i18n_onair/configuration.rb', line 3 def lazy_load_locales @lazy_load_locales end |
#live_ui ⇒ Object
Returns the value of attribute live_ui.
3 4 5 |
# File 'lib/rails_i18n_onair/configuration.rb', line 3 def live_ui @live_ui end |
#locale_files_path ⇒ Object
Returns the value of attribute locale_files_path.
3 4 5 |
# File 'lib/rails_i18n_onair/configuration.rb', line 3 def locale_files_path @locale_files_path end |
#storage_mode ⇒ Object
Returns the value of attribute storage_mode.
3 4 5 |
# File 'lib/rails_i18n_onair/configuration.rb', line 3 def storage_mode @storage_mode end |
Instance Method Details
#database_mode? ⇒ Boolean
25 26 27 |
# File 'lib/rails_i18n_onair/configuration.rb', line 25 def database_mode? @storage_mode == :database end |
#file_mode? ⇒ Boolean
29 30 31 |
# File 'lib/rails_i18n_onair/configuration.rb', line 29 def file_mode? @storage_mode == :file end |
#live_ui? ⇒ Boolean
33 34 35 |
# File 'lib/rails_i18n_onair/configuration.rb', line 33 def live_ui? @live_ui == true end |