Functional tests now work properly, bearing in mind whether a user is logged in or...
[depot.git] / vendor / rails / actionpack / lib / action_view / helpers / translation_helper.rb
1 require 'action_view/helpers/tag_helper'
2
3 module ActionView
4 module Helpers
5 module TranslationHelper
6 def translate(key, options = {})
7 options[:raise] = true
8 I18n.translate(key, options)
9 rescue I18n::MissingTranslationData => e
10 keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
11 content_tag('span', keys.join(', '), :class => 'translation_missing')
12 end
13 alias :t :translate
14
15 def localize(*args)
16 I18n.localize *args
17 end
18 alias :l :localize
19 end
20 end
21 end