Module: I18n

Defined in:
lib/delocalize/i18n_ext.rb

Class Method Summary collapse

Class Method Details

.delocalization_disabled?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/delocalize/i18n_ext.rb', line 12

def delocalization_disabled?
  !delocalization_enabled?
end

.delocalization_enabled?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/delocalize/i18n_ext.rb', line 8

def delocalization_enabled?
  !!I18n.enable_delocalization
end

.with_delocalization_disabled(&block) ⇒ Object



16
17
18
19
20
21
# File 'lib/delocalize/i18n_ext.rb', line 16

def with_delocalization_disabled(&block)
  old_value = I18n.enable_delocalization
  I18n.enable_delocalization = false
  yield
  I18n.enable_delocalization = old_value
end

.with_delocalization_enabled(&block) ⇒ Object



23
24
25
26
27
28
# File 'lib/delocalize/i18n_ext.rb', line 23

def with_delocalization_enabled(&block)
  old_value = I18n.enable_delocalization
  I18n.enable_delocalization = true
  yield
  I18n.enable_delocalization = old_value
end