Appease the mighty dog overlords (fix Ruby code nits)

This commit is contained in:
Andreas Nedbal 2022-01-23 21:06:33 +01:00 committed by Andreas Nedbal
parent aec10cbb9a
commit fb812d4f36

View file

@ -11,25 +11,25 @@ class ApplicationController < ActionController::Base
# check if user wants to read # check if user wants to read
def check_locale def check_locale
return I18n.locale = 'en' if Rails.env.test? return I18n.locale = "en" if Rails.env.test?
I18n.locale = 'en' I18n.locale = "en"
# if params[:hl].nil? # if params[:hl].nil?
# if current_user.present? # if current_user.present?
# I18n.locale = current_user.locale # I18n.locale = current_user.locale
# elsif not cookies[:lang].nil? # elsif not cookies[:lang].nil?
# I18n.locale = cookies[:lang] # I18n.locale = cookies[:lang]
# else # else
# I18n.locale = 'en' # I18n.locale = 'en'
# end # end
# else # else
# I18n.locale = params[:hl] # I18n.locale = params[:hl]
# if current_user.present? # if current_user.present?
# current_user.locale = I18n.locale # current_user.locale = I18n.locale
# current_user.save! # current_user.save!
# end # end
# end # end
cookies[:lang] = I18n.locale cookies[:lang] = I18n.locale
end end