Q:

How can I add I18n capabilities to my step definitions in cucumber?

env.rb => 
  def setup_language_resources
     I18n.load_path = ['features/configuration_resources/english.yml']

     case ENV['Language']
     when 'english'
       I18n.locale = :en
     when 'spanish'
       I18n.locale = :es
     when 'italian'
       I18n.locale = :it
     else
       abort("Incorrect language set, cannot continue the test run: supported are 'english', 'italian' or 'spanish'")
     end
   end

   setup_language_resources

steps =>
expect(@browser.text.include?(I18N.t('successful-adoption'))).to be true

How can i reference my I18n.t function inside the step definition, how should i pass it into the "world" to have it available there?
yml =>
---
en:
  successful-adoption: "Thank you for adopting a puppy!"

Error is: uninitialized constant I18N (NameError)

A:

simply just add an instance var inside the hooks @before method.
  Before do |scenario|
    @locale = I18n
    @log = setup_logger("#{scenario.name}")
    @log.debug("Starting scenario: #{scenario.name}")
  end

