i18n sign in

This commit is contained in:
Pete Matsyburka
2024-06-08 23:02:29 +03:00
parent 54272d83eb
commit af787887d8
6 changed files with 296 additions and 17 deletions
+2 -1
View File
@@ -52,7 +52,8 @@ class ApplicationController < ActionController::Base
private
def with_browser_locale(&)
locale = request.env['HTTP_ACCEPT_LANGUAGE'].to_s[BROWSER_LOCALE_REGEXP].to_s
locale = params[:lang].presence
locale ||= request.env['HTTP_ACCEPT_LANGUAGE'].to_s[BROWSER_LOCALE_REGEXP].to_s
locale =
if locale.starts_with?('en-') && locale != 'en-US'
+2
View File
@@ -3,6 +3,8 @@
class SessionsController < Devise::SessionsController
before_action :configure_permitted_parameters
around_action :with_browser_locale
def create
email = sign_in_params[:email].to_s.downcase