lib/garcon/core_ext/string.rb
# Formats String for easy translation. Replaces an arbitrary number of
# values using numeric identifier replacement.
#
# @example
#   "%s %s %s" % %w(one two three)        # => 'one two three'
#   "%3$s %2$s %1$s" % %w(one two three)  # => 'three two one'
#
# @param [#to_s] values
#   A list of values to translate and interpolate into receiver
#
# @return [String]
#   Receiver translated with values translated and interpolated positionally
#
# @api public
Formats String for easy translation. Replaces an arbitrary number of
values using numeric identifier replacement.
Formats String for easy translation . Replaces an arbitrary number of values using numeric identifier replacement .
def t(*values)
    self.class::translate(self) % values.collect! do |value|
      value.frozen? ? value : self.class::translate(value.to_s)
    end
  end
def t ( * values ) self . class :: translate ( self ) % values . collect! do | value | value . frozen? ? value : self . class :: translate ( value . to_s ) end end
Formats String for easy translation.
Formats String for easy translation .
Receiver translated with values translated and interpolated positionally
Receiver translated with values translated and interpolated positionally
String
values
<not_specific>
<not_specific>
values A list of values to translate and interpolate into receiver
values A list of values to translate and interpolate into receiver
example
None
api
None