### Add i18n-debug Gem to Gemfile (Ruby) Source: https://github.com/fphilipe/i18n-debug/blob/master/README.md Adds the `i18n-debug` gem to the project's `Gemfile`. It is typically placed within the `:development` group to ensure it's only available during development, avoiding unnecessary dependencies in production. ```Ruby gem 'i18n-debug', group: :development ``` -------------------------------- ### Define Custom Lookup Handler for I18n::Debug (Ruby) Source: https://github.com/fphilipe/i18n-debug/blob/master/README.md Sets a custom lambda or Proc to be executed every time an I18n lookup occurs. The handler receives the `key` and `value` of the lookup, enabling custom logic such as collecting statistics, sending data elsewhere, or modifying the logging format. ```Ruby # Collect stats on I18n key usage. i18n_stats = Hash.new { |stats, key| stats[key] = 0 } I18n::Debug.on_lookup do |key, value| i18n_stats[key] += 1 if value end ``` -------------------------------- ### Set Custom Logger for I18n::Debug (Ruby) Source: https://github.com/fphilipe/i18n-debug/blob/master/README.md Assigns a custom logger object to `I18n::Debug.logger`. The custom logger must respond to the `debug` method, allowing users to integrate the gem's output with their preferred logging system. ```Ruby I18n::Debug.logger = my_custom_logger ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.