Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
maricavor authored Sep 7, 2023
2 parents 68981ae + 7da2de2 commit 4792323
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
06.09.2023
* Set localization in url https://github.com/internetee/auction_center/pull/1119

21.08.2023
* Fix for GA4 (Google Analytics) https://github.com/internetee/auction_center/pull/1114

Expand Down
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ class ApplicationController < ActionController::Base
policy.style_src :self, 'www.gstatic.com', :unsafe_inline
end

rescue_from CanCan::AccessDenied do |exception|
rescue_from CanCan::AccessDenied do |_exception|
flash[:alert] = I18n.t('unauthorized.message')
redirect_to root_url
end

def set_locale
if params[:localize].present? && I18n.available_locales.include?(params[:localize].to_sym)
cookies[:locale] = params[:localize]
end

I18n.locale = current_user&.locale || cookies[:locale] || I18n.default_locale
@pagy_locale = I18n.locale.to_s
end
Expand Down

0 comments on commit 4792323

Please sign in to comment.