Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A little less hokus pokus

  • Loading branch information...
commit 3e54a9a689915c28bc806498e5d1d1af91255fb0 1 parent c94ba81
@dhh dhh authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 actionpack/lib/action_view/helpers/translation_helper.rb
View
9 actionpack/lib/action_view/helpers/translation_helper.rb
@@ -3,12 +3,11 @@
module ActionView
module Helpers
module TranslationHelper
- def translate(*args)
- args << args.extract_options!.merge(:raise => true)
- I18n.translate *args
-
+ def translate(key, options = {})
+ options[:raise] = true
+ I18n.translate(key, options)
rescue I18n::MissingTranslationData => e
- keys = I18n.send :normalize_translation_keys, e.locale, e.key, e.options[:scope]
+ keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
content_tag('span', keys.join(', '), :class => 'translation_missing')
end
alias :t :translate

2 comments on commit 3e54a9a

@josh
Collaborator

I think that can be the new Rails tag line

@nbibler

A little less hokus pokus .. a little more action, please, all this aggravation ain’t satisfactionin’ me.

I could see this as an Apple-esque Rails commercial, with a little help from Elvis, of course. ;)

Please sign in to comment.
Something went wrong with that request. Please try again.