Froze rails gems
[depot.git] / vendor / rails / actionpack / lib / action_view / helpers / translation_helper.rb
diff --git a/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb b/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb
new file mode 100644 (file)
index 0000000..dc41ef5
--- /dev/null
@@ -0,0 +1,21 @@
+require 'action_view/helpers/tag_helper'
+
+module ActionView
+  module Helpers
+    module TranslationHelper
+      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])
+        content_tag('span', keys.join(', '), :class => 'translation_missing')
+      end
+      alias :t :translate
+
+      def localize(*args)
+        I18n.localize *args
+      end
+      alias :l :localize
+    end
+  end
+end
\ No newline at end of file