Sha256: 03c93e25ac20aa953dad8e2f500ccb724b4ce2d7ca4a25a84d593401dce20315

Contents?: true

Size: 467 Bytes

Versions: 8

Compression:

Stored size: 467 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:
  #
  #     _t("Hello World!")
  #
  # Note that interpolation still works ...
  #
  #     _t("Hello %{world}!", :world => @world)
  #
  def _t(msg, *args)
    options = args.extract_options!
    options[:default] = msg
    I18n.t(msg, options)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
typus-3.0.2 lib/support/object.rb
typus-3.0.1 lib/support/object.rb
typus-3.0.0 lib/support/object.rb
typus-1.0.0.pre13 lib/support/object.rb
typus-1.0.0.pre12 lib/support/object.rb
typus-1.0.0.pre11 lib/support/object.rb
typus-1.0.0.pre10 lib/support/object.rb
typus-1.0.0.pre9 lib/support/object.rb