Change locales structure (#144)

This commit is contained in:
Riccardo Graziosi
2022-07-23 13:32:40 +02:00
committed by GitHub
parent 881708c77c
commit a6c630949a
26 changed files with 273 additions and 285 deletions

View File

@@ -51,7 +51,7 @@ class ApplicationController < ActionController::Base
def user_not_authorized
render json: {
error: t('backend.errors.unauthorized')
error: t('errors.unauthorized')
}, status: :unauthorized
end
end

View File

@@ -70,7 +70,7 @@ class BoardsController < ApplicationController
render json: workflow_output
else
render json: {
error: t("backend.errors.board.update_order")
error: t("errors.board.update_order")
}, status: :unprocessable_entity
end
end

View File

@@ -66,7 +66,7 @@ class PostStatusesController < ApplicationController
render json: workflow_output
else
render json: {
error: t("backend.errors.post_status.update_order")
error: t("errors.post_status.update_order")
}, status: :unprocessable_entity
end
end

View File

@@ -1,7 +1,7 @@
module ApplicationHelper
def check_user_signed_in
unless user_signed_in?
flash[:alert] = t('backend.errors.not_logged_in')
flash[:alert] = t('errors.not_logged_in')
redirect_to new_user_session_path
return false
@@ -12,7 +12,7 @@ module ApplicationHelper
return if check_user_signed_in == false
unless current_user.admin?
flash[:alert] = t('backend.errors.not_enough_privileges')
flash[:alert] = t('errors.not_enough_privileges')
redirect_to root_path
return
end
@@ -22,7 +22,7 @@ module ApplicationHelper
return if check_user_signed_in == false
unless current_user.admin? or current_user.moderator?
flash[:alert] = t('backend.errors.not_enough_privileges')
flash[:alert] = t('errors.not_enough_privileges')
redirect_to root_path
return
end

View File

@@ -37,7 +37,7 @@ class User < ApplicationRecord
end
def inactive_message
active? ? super : :blocked_or_deleted
active? ? super : I18n.t('errors.user_blocked_or_deleted')
end
# Override Devise::Confirmable#after_confirmation