Module: I18nLookupTracer

Defined in:
lib/i18n_lookup_tracer.rb,
lib/i18n_lookup_tracer/version.rb

Constant Summary collapse

VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.setupObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/i18n_lookup_tracer.rb', line 4

def self.setup
  I18n::Backend::Simple::Implementation.class_eval do
    alias :old_lookup :lookup
    protected
    def lookup(locale, key, scope = [], options = {})
      init_translations unless initialized?
      keys = I18n.normalize_keys(locale, key, scope, options[:separator])
      Rails.logger.info "I18n key lookup: #{keys.join(".")}"
      old_lookup(locale, key, scope, options)
    end
  end
end