Sha256: 15b48133677e5d7b511235f7ec171e4a0c0bfad7b38cbe7f4f13ea429c6b13f9

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

module RailsLocaleDetection
  class LocaleDetector
    include DetectionMethods
    include LocaleAccessors
    
    attr_reader :controller
    
    delegate :params, :request, :default_url_options, :user_locale, :to => :controller
    
    def initialize(controller = nil)
      @controller = controller
    end
    
    def cookies
      request.cookie_jar
    end
    
    def locale_key
      RailsLocaleDetection.locale_key
    end
    
    def self.before(controller)
      new(controller).set_locale
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_locale_detection-2.0.0.pre4 lib/rails_locale_detection/locale_detector.rb
rails_locale_detection-2.0.0.pre3 lib/rails_locale_detection/locale_detector.rb