Module: OxAiWorkers::LoadI18n

Included in:
Assistant::ModuleBase, Iterator, Tool::Database, Tool::Eval, Tool::FileSystem
Defined in:
lib/oxaiworkers/load_i18n.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#localeObject

Returns the value of attribute locale.



10
11
12
# File 'lib/oxaiworkers/load_i18n.rb', line 10

def locale
  @locale
end

Instance Method Details

#store_localeObject



17
18
19
# File 'lib/oxaiworkers/load_i18n.rb', line 17

def store_locale
  @locale = I18n.locale
end

#with_locale(&action) ⇒ Object



12
13
14
15
# File 'lib/oxaiworkers/load_i18n.rb', line 12

def with_locale(&action)
  # locale = respond_to?(:locale) ? self.locale : OxAiWorkers.configuration.locale
  I18n.with_locale(@locale, &action)
end