Methods

Class/Module Index [+]

Quicksearch

HammerCLI::I18n::Debug

include this module to see translations highlighted

Constants

DL
DR

Public Instance Methods

_(key) click to toggle source

slightly modified copy of fast_gettext D_* method

# File lib/hammer_cli/i18n.rb, line 31
def _(key)
  FastGettext.translation_repositories.each_key do |domain|
    result = FastGettext::TranslationMultidomain.d_(domain, key) {nil}
    return DL + result + DR unless result.nil?
  end
  DL + key + DR
end
n_(*keys) click to toggle source

slightly modified copy of fast_gettext D_* method

# File lib/hammer_cli/i18n.rb, line 40
def n_(*keys)
  FastGettext.translation_repositories.each_key do |domain|
    result = FastGettext::TranslationMultidomain.dn_(domain, *keys) {nil}
    return DL + result + DR unless result.nil?
  end
  DL + keys[-3].split(keys[-2]||FastGettext::NAMESPACE_SEPARATOR).last + DR
end
ns_(*keys) click to toggle source

slightly modified copy of fast_gettext D_* method

# File lib/hammer_cli/i18n.rb, line 58
def ns_(*keys)
  FastGettext.translation_repositories.each_key do |domain|
    result = FastGettext::TranslationMultidomain.dns_(domain, *keys) {nil}
    return DL + result + DR unless result.nil?
  end
  DL + keys[-2].split(FastGettext::NAMESPACE_SEPARATOR).last + DR
end
s_(key, separator=nil) click to toggle source

slightly modified copy of fast_gettext D_* method

# File lib/hammer_cli/i18n.rb, line 49
def s_(key, separator=nil)
  FastGettext.translation_repositories.each_key do |domain|
    result = FastGettext::TranslationMultidomain.ds_(domain, key, separator) {nil}
    return DL + result + DR unless result.nil?
  end
  DL + key.split(separator||FastGettext::NAMESPACE_SEPARATOR).last + DR
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.