From 3e54a9a689915c28bc806498e5d1d1af91255fb0 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 28 Oct 2008 16:51:08 +0100 Subject: A little less hokus pokus --- actionpack/lib/action_view/helpers/translation_helper.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_view/helpers') 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 -- cgit v1.2.3