Created
August 26, 2014 22:48
-
-
Save ArthurN/098ff49d10c2f386b93c to your computer and use it in GitHub Desktop.
Peak into what I18n namespaces are attempted by third party gems
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
# This monkeypatch logs any calls to I18n#t. This is especially useful to "peaking" into what namespaces are expected | |
# for third party gems, e.g. simple_form or reform. | |
I18n.module_eval do | |
class << self | |
def translate_with_puts(*args) | |
Rails.logger.debug "#{args}" | |
old_translate(*args) | |
end | |
alias :old_translate :translate | |
alias :translate :translate_with_puts | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment