public
Last active

Output debugging information about i18n translation lookups that are occurring.

  • Download Gist
i18n_debug.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
require 'i18n'
 
if (Rails.env.development? || Rails.env.test?) && ENV['DEBUG_TRANSLATION']
module I18n
class << self
def translate_with_debug(*args)
puts "Translate: #{args.inspect}"
translate_without_debug(*args)
end
alias_method_chain :translate, :debug
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.