instiki/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

22 lines
580 B
Ruby

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
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