Module: FormTranslation::SwitchLocale::ClassMethods
- Defined in:
- lib/form_translation/active_record.rb
Instance Method Summary collapse
Instance Method Details
#form_translation_locale ⇒ Object
21 22 23 |
# File 'lib/form_translation/active_record.rb', line 21 def form_translation_locale @@_form_translation_locale ||= nil end |
#with_locale(loc, &block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/form_translation/active_record.rb', line 13 def with_locale(loc, &block) raise "unsupported language #{loc}" unless FormTranslation.languages.member? loc t = self.class_variable_get(:@@_form_translation_locale) @@_form_translation_locale = loc yield @@_form_translation_locale = t end |