diff options
Diffstat (limited to 'actionpack')
-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 |