Created
July 19, 2013 15:16
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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