Module: HammerCLI::I18n::Debug

Defined in:
lib/hammer_cli/i18n.rb

Overview

include this module to see translations highlighted

Constant Summary collapse

DL =
'>'
DR =
'<'

Instance Method Summary collapse

Instance Method Details

#_(key) ⇒ Object

slightly modified copy of fast_gettext _ method



15
16
17
# File 'lib/hammer_cli/i18n.rb', line 15

def _(key)
  _wrap { FastGettext::Translation._(key) }
end

#_wrap(&block) ⇒ Object



34
35
36
37
# File 'lib/hammer_cli/i18n.rb', line 34

def _wrap(&block)
  result = yield
  DL + result + DR unless result.nil?
end

#n_(*keys) ⇒ Object

slightly modified copy of fast_gettext n_ method



20
21
22
# File 'lib/hammer_cli/i18n.rb', line 20

def n_(*keys)
  _wrap { FastGettext::Translation.n_(*keys) }
end

#ns_(*args, &block) ⇒ Object

slightly modified copy of fast_gettext ns_ method



30
31
32
# File 'lib/hammer_cli/i18n.rb', line 30

def ns_(*args, &block)
  _wrap { FastGettext::Translation.ns_(*args, &block) }
end

#s_(key, separator = nil, &block) ⇒ Object

slightly modified copy of fast_gettext s_ method



25
26
27
# File 'lib/hammer_cli/i18n.rb', line 25

def s_(key, separator=nil, &block)
  _wrap { FastGettext::Translation.s_(key, separator, &block) }
end