Sha256: 541080149b44260d90baef71610c530ea0e4997e7f22b64c7e73898cf205005d

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

module I18n
  module Screwdriver
    def self.included(klass)
      klass.send :include, InstanceMethods
    end
    
    module InstanceMethods
      def _(translation)
        # the . is a special character in rails i18n - we have to strip it
        translation_without_dot = translation.gsub(/\./, '').strip
        I18n.translate("#{translation_without_dot}")
      end
    end
  end
end

ActionView::Base.send :include, I18n::Screwdriver
ActionController::Base.send :include, I18n::Screwdriver
ActionController::IntegrationTest.send :include, I18n::Screwdriver
ActionController::TestCase.send :include, I18n::Screwdriver

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n_screwdriver-0.5.0 lib/i18n_screwdriver.rb