def set_locale
      self.current_locale = detect_locale

      if set_default_url_option_for_request?
        default_url_options[locale_key] = current_locale
      end

      if locale_from_cookie != current_locale
        cookies[locale_key] = {
          :value => current_locale,
          :expires => RailsLocaleDetection.locale_expiry.from_now
        }
      end
    end
def set_locale
      self.current_locale = detect_locale

      if set_default_url_option_for_request?
        default_url_options[locale_key] = current_locale
      end

      if locale_from_cookie != current_locale
        cookies[locale_key] = {
          :value => current_locale,
          :expires => RailsLocaleDetection.locale_expiry.from_now
        }
      end
    end
set I18n.locale, default_url_options[:locale] and cookies[:locale]
 to the value returned by detect_locale