Sha256: 2807b9fb9bde8d683e3f5ba6ea5fde0fb40cc69009d8baf3b96433660bbf9eb0

Contents?: true

Size: 342 Bytes

Versions: 6

Compression:

Stored size: 342 Bytes

Contents

module Rad::Controller::Http::Localized
  inherited do
    before :prepare_locale
  end

  protected     
    def prepare_locale
      language = rad.environment.language
      I18n.locale = params.l || language        
      # Delete l from params if language is the same as default
      params.delete :l if params.l == language
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rad_kit-0.0.6 lib/kit/http_controller/localized.rb
rad_kit-0.0.5 lib/kit/http_controller/localized.rb
rad_kit-0.0.4 lib/kit/http_controller/localized.rb
rad_kit-0.0.3 lib/kit/http_controller/localized.rb
rad_kit-0.0.2 lib/kit/http_controller/localized.rb
rad_kit-0.0.1 lib/kit/http_controller/localized.rb