Skip to content

Instantly share code, notes, and snippets.

@capripot
Created March 24, 2015 19:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capripot/6e6cf778ad2db0443280 to your computer and use it in GitHub Desktop.
Save capripot/6e6cf778ad2db0443280 to your computer and use it in GitHub Desktop.
Show Rails i18n default scope
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