Sha256: ebe873d7d5be0b230ce358cbad505adbc530161ba463321ecc953a1ad53b9a51

Contents?: true

Size: 571 Bytes

Versions: 4

Compression:

Stored size: 571 Bytes

Contents

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

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/actionpack/pkg/actionpack-2.2.2/lib/action_view/helpers/translation_helper.rb
actionpack-2.2.3 lib/action_view/helpers/translation_helper.rb
actionpack-2.2.2 lib/action_view/helpers/translation_helper.rb