Sha256: bdbe66ce1f1d67909278d0e964918a4aa174ff4bcd17719437bcbab3bef0306f

Contents?: true

Size: 459 Bytes

Versions: 25

Compression:

Stored size: 459 Bytes

Contents

class Object

  # Instead of having to translate strings and defining a default value:
  #
  #     t("Hello World!", :default => 'Hello World!')
  #
  # We define this method to define the value only once:
  #
  #     _("Hello World!")
  #
  # Note that interpolation still works ...
  #
  #     _("Hello {{world}}!", :world => @world)
  #
  def _(msg, *args)
    options = args.extract_options!
    options[:default] = msg
    I18n.t(msg, options)
  end

end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
fesplugas-typus-0.9.16 lib/typus/object.rb
fesplugas-typus-0.9.17 lib/typus/object.rb
typus-0.9.39 lib/typus/object.rb
typus-0.9.38 lib/typus/object.rb
typus-0.9.37 lib/typus/object.rb
typus-0.9.36 lib/typus/object.rb
typus-0.9.35 lib/typus/object.rb
typus-0.9.34 lib/typus/object.rb
typus-0.9.33 lib/typus/object.rb
typus-0.9.32 lib/typus/object.rb
typus-0.9.31 lib/typus/object.rb
typus-0.9.30 lib/typus/object.rb
typus-0.9.29 lib/typus/object.rb
typus-0.9.28 lib/typus/object.rb
typus-0.9.27 lib/typus/object.rb
typus-0.9.26 lib/typus/object.rb
typus-0.9.25 lib/typus/object.rb
typus-0.9.24 lib/typus/object.rb
typus-0.9.23 lib/typus/object.rb
typus-0.9.22 lib/typus/object.rb