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.
-
#harvest_paths ⇒ Object
readonly
Returns the value of attribute harvest_paths.
-
#locales ⇒ Object
Returns the value of attribute locales.
-
#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.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/zlocalize/config.rb', line 10 def initialize @return_source_on_missing = { :development => true, :test => false, :production => false, :staging => false } @harvest_paths = [ "app/channels/**/*.rb", "app/controllers/**/*.rb", "app/helpers/**/*.rb", "app/models/**/*.rb", "app/views/**/*.erb", "app/mailers/**/*.rb", "app/jobs/**/*.rb", "lib/**/*.rb" ] @locales = {} @use_global_gettext_methods = true end |
Instance Attribute Details
#define_gettext_methods ⇒ Object
Returns the value of attribute define_gettext_methods.
7 8 9 |
# File 'lib/zlocalize/config.rb', line 7 def define_gettext_methods @define_gettext_methods end |
#harvest_paths ⇒ Object (readonly)
Returns the value of attribute harvest_paths.
8 9 10 |
# File 'lib/zlocalize/config.rb', line 8 def harvest_paths @harvest_paths end |
#locales ⇒ Object
Returns the value of attribute locales.
6 7 8 |
# File 'lib/zlocalize/config.rb', line 6 def locales @locales end |
#return_source_on_missing ⇒ Object
Returns the value of attribute return_source_on_missing.
5 6 7 |
# File 'lib/zlocalize/config.rb', line 5 def return_source_on_missing @return_source_on_missing end |
Instance Method Details
#please_define_gettext_methods ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/zlocalize/config.rb', line 45 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 |