takes a canonical wizard value and translates to correct language
es.yml wicked:
first: "uno" wizard_translate("first") # => :uno
# File lib/wicked/wizard/translated.rb, line 43 def wizard_translate(step_name) I18n.t("wicked.#{step_name}") end
creates a hash where keys are translated steps, values are the name of the view file
es: hello: "hola mundo" wicked: first: "uno" second: "dos" steps :first, :second
{:uno => :first, :dos => :second} # spanish {:first => :first, :second => :second} # english
# File lib/wicked/wizard/translated.rb, line 27 def wizard_translations @wizard_translations ||= steps.inject(ActiveSupport::OrderedHash.new) do |hash, step| step = step.to_s.split(".").last translation = wizard_translate(step) hash[translation] = step.to_s hash end end
Generated with the Darkfish Rdoc Generator 2.