instiki/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb
Jacques Distler 2e81ca2d30 Rails 2.2.2
Updated to Rails 2.2.2.
Added a couple more Ruby 1.9 fixes, but that's pretty much at a standstill,
until one gets Maruku and HTML5lib working right under Ruby 1.9.
2008-11-24 15:53:39 -06:00

21 lines
571 B
Ruby

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