diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-28 16:51:08 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-28 16:51:08 +0100 |
commit | 3e54a9a689915c28bc806498e5d1d1af91255fb0 (patch) | |
tree | 08d7cc544f3e0637af4a45bd19eaa073e23d9ee3 /actionpack/lib | |
parent | c94ba8150a726da4a894cd8325ee682a3286ec9f (diff) | |
download | rails-3e54a9a689915c28bc806498e5d1d1af91255fb0.tar.gz rails-3e54a9a689915c28bc806498e5d1d1af91255fb0.tar.bz2 rails-3e54a9a689915c28bc806498e5d1d1af91255fb0.zip |
A little less hokus pokus
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/translation_helper.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb index de4c1d7689..dc41ef5305 100644 --- a/actionpack/lib/action_view/helpers/translation_helper.rb +++ b/actionpack/lib/action_view/helpers/translation_helper.rb @@ -3,12 +3,11 @@ require 'action_view/helpers/tag_helper' 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 |