Created
March 24, 2015 19:32
-
-
Save capripot/6e6cf778ad2db0443280 to your computer and use it in GitHub Desktop.
Show Rails i18n default scope
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
module I18n | |
module Backend | |
class Simple | |
module Implementation | |
alias_method :lookup_orig, :lookup | |
# Give ability to check I18n looked up keys in lazy mode by setting env var I18N_DEBUG to true | |
# | |
def lookup(locale, key, scope = [], options = {}) | |
puts "I18N keys: #{I18n.normalize_keys(locale, key, scope, options[:separator])}" if ENV['I18N_DEBUG'] | |
lookup_orig(locale, key, scope, options) | |
end | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment