Skip to content

Instantly share code, notes, and snippets.

@datenimperator
Created July 19, 2013 15:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datenimperator/6039855 to your computer and use it in GitHub Desktop.
Save datenimperator/6039855 to your computer and use it in GitHub Desktop.
Did you ever wonder what your Rails i18n is doing? Why your translation isn't found? Add this initializer to log every i18n translation as it happens.
I18n::Backend::Base.class_eval do
def translate_with_logging(locale, key, options = {})
Rails.logger.debug " i18n: #{locale} #{key} #{options.inspect}"
translate_without_logging(locale, key, options)
end
alias_method_chain :translate, :logging
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment