lib/typus/i18n.rb in typus-3.1.8 vs lib/typus/i18n.rb in typus-3.1.9
- old
+ new
@@ -3,20 +3,18 @@
module Typus
module I18n
class << self
- ##
- # Instead of having to translate strings and defining a default value:
+ # Instead of having to translate strings and defining a default
+ # value to avoid "missing translation" messages:
#
- # Typus::I18n.t("Hello World!", :default => 'Hello World!')
+ # I18n.t("Hello World!", :default => 'Hello World!')
#
- # We define this method to define the value only once:
+ # We define a Typus translation method which will set up a default
+ # value for you: (Interpolation still works)
#
# Typus::I18n.t("Hello World!")
- #
- # Note that interpolation still works:
- #
# Typus::I18n.t("Hello %{world}!", :world => @world)
#
def t(key, options = {})
options[:default] ||= key
::I18n.t(key, options)