Class: ZLocalize::Config
- Inherits:
-
Object
- Object
- ZLocalize::Config
- Defined in:
- lib/zlocalize/config.rb
Instance Attribute Summary collapse
-
#define_gettext_methods ⇒ Object
Returns the value of attribute define_gettext_methods.
-
#locales ⇒ Object
Returns the value of attribute locales.
-
#reload_per_request ⇒ Object
Returns the value of attribute reload_per_request.
-
#return_source_on_missing ⇒ Object
Returns the value of attribute return_source_on_missing.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #please_define_gettext_methods ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 17 |
# File 'lib/zlocalize/config.rb', line 12 def initialize @reload_per_request = { :development => true, :test => false, :production => false, :staging => false } @return_source_on_missing = { :development => true, :test => false, :production => false, :staging => false } @locales = {} @use_global_gettext_methods = true end |
Instance Attribute Details
#define_gettext_methods ⇒ Object
Returns the value of attribute define_gettext_methods.
10 11 12 |
# File 'lib/zlocalize/config.rb', line 10 def define_gettext_methods @define_gettext_methods end |
#locales ⇒ Object
Returns the value of attribute locales.
9 10 11 |
# File 'lib/zlocalize/config.rb', line 9 def locales @locales end |
#reload_per_request ⇒ Object
Returns the value of attribute reload_per_request.
6 7 8 |
# File 'lib/zlocalize/config.rb', line 6 def reload_per_request @reload_per_request end |
#return_source_on_missing ⇒ Object
Returns the value of attribute return_source_on_missing.
7 8 9 |
# File 'lib/zlocalize/config.rb', line 7 def return_source_on_missing @return_source_on_missing end |
Instance Method Details
#please_define_gettext_methods ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/zlocalize/config.rb', line 48 def please_define_gettext_methods Object.class_eval <<-EOV def _(key,options = {}) ZLocalize.translate(key, options) end def n_(key,count,options = {}) ZLocalize.pluralize(key,count,options) end EOV end |