Add new translations for ban flash message
This commit is contained in:
parent
a3e030bd10
commit
39639c2d85
|
@ -23,14 +23,14 @@ class ApplicationController < ActionController::Base
|
||||||
if current_user.present? && current_user.banned?
|
if current_user.present? && current_user.banned?
|
||||||
name = current_user.screen_name
|
name = current_user.screen_name
|
||||||
# obligatory '2001: A Space Odyssey' reference
|
# obligatory '2001: A Space Odyssey' reference
|
||||||
flash[:notice] = t('flash.ban.error', name: name)
|
flash[:notice] = t(".banned", name: name)
|
||||||
current_ban = current_user.bans.current.first
|
current_ban = current_user.bans.current.first
|
||||||
unless current_ban&.reason.nil?
|
unless current_ban&.reason.nil?
|
||||||
flash[:notice] += "\n#{t('flash.ban.reason', reason: current_ban.reason)}"
|
flash[:notice] += "\n#{t('.reason', reason: current_ban.reason)}"
|
||||||
end
|
end
|
||||||
unless current_ban&.permanent?
|
unless current_ban&.permanent?
|
||||||
# TODO format banned_until
|
# TODO format banned_until
|
||||||
flash[:notice] += "\n#{t('flash.ban.until', time: current_ban.expires_at)}"
|
flash[:notice] += "\n#{t('.until', time: current_ban.expires_at)}"
|
||||||
end
|
end
|
||||||
sign_out current_user
|
sign_out current_user
|
||||||
redirect_to new_user_session_path
|
redirect_to new_user_session_path
|
||||||
|
|
|
@ -183,6 +183,9 @@ en:
|
||||||
user:
|
user:
|
||||||
sessions:
|
sessions:
|
||||||
create:
|
create:
|
||||||
|
banned: "I'm sorry, %{name}, I'm afraid I can't do that."
|
||||||
|
reason: "Ban reason: %{reason}"
|
||||||
|
until: "Banned until: %{time}"
|
||||||
info: "You have %{count} recovery codes remaining."
|
info: "You have %{count} recovery codes remaining."
|
||||||
error: :errors.invalid_otp
|
error: :errors.invalid_otp
|
||||||
registrations:
|
registrations:
|
||||||
|
|
Loading…
Reference in New Issue