Skip to content

Instantly share code, notes, and snippets.

@pauljamesrussell
Created December 4, 2011 23:23
Show Gist options
  • Save pauljamesrussell/1431633 to your computer and use it in GitHub Desktop.
Save pauljamesrussell/1431633 to your computer and use it in GitHub Desktop.
Output debugging information about i18n translation lookups that are occurring.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment