add missing i18n
This commit is contained in:
parent
1d8fefcfb7
commit
a8ace3bc79
3 changed files with 13 additions and 3 deletions
|
@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
def deny_access
|
def deny_access
|
||||||
session[:return_to] = request.original_url
|
session[:return_to] = request.original_url
|
||||||
redirect_to login_url, :alert => 'Access denied!'
|
redirect_to login_url, :alert => I18n.t('application.controller.error_denied')
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base
|
||||||
# No user at all: redirect to login page.
|
# No user at all: redirect to login page.
|
||||||
session[:user_id] = nil
|
session[:user_id] = nil
|
||||||
session[:return_to] = request.original_url
|
session[:return_to] = request.original_url
|
||||||
redirect_to login_url, :alert => 'Authentication required!'
|
redirect_to login_url, :alert => I18n.t('application.controller.error_authn')
|
||||||
else
|
else
|
||||||
# We have an authenticated user, now check role...
|
# We have an authenticated user, now check role...
|
||||||
# Roles gets the user through his memberships.
|
# Roles gets the user through his memberships.
|
||||||
|
@ -83,7 +83,7 @@ class ApplicationController < ActionController::Base
|
||||||
def authenticate_membership_or_admin
|
def authenticate_membership_or_admin
|
||||||
@group = Group.find(params[:id])
|
@group = Group.find(params[:id])
|
||||||
unless @group.member?(@current_user) or @current_user.role_admin?
|
unless @group.member?(@current_user) or @current_user.role_admin?
|
||||||
redirect_to root_path, alert: "Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!"
|
redirect_to root_path, alert: I18n.t('application.controller.error_members_only')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,11 @@ de:
|
||||||
workgroups:
|
workgroups:
|
||||||
members: Mitglieder
|
members: Mitglieder
|
||||||
name: Name
|
name: Name
|
||||||
|
application:
|
||||||
|
controller:
|
||||||
|
error_denied:
|
||||||
|
error_authn:
|
||||||
|
error_members_only: 'Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!'
|
||||||
article_categories:
|
article_categories:
|
||||||
create:
|
create:
|
||||||
notice: Die Kategorie wurde gespeichert
|
notice: Die Kategorie wurde gespeichert
|
||||||
|
|
|
@ -212,6 +212,11 @@ en:
|
||||||
workgroups:
|
workgroups:
|
||||||
members: members
|
members: members
|
||||||
name: name
|
name: name
|
||||||
|
application:
|
||||||
|
controller:
|
||||||
|
error_denied: 'Access denied!'
|
||||||
|
error_authn: 'Authentication required!'
|
||||||
|
error_members_only: 'This action is only available to members of the group!'
|
||||||
article_categories:
|
article_categories:
|
||||||
create:
|
create:
|
||||||
notice: Category was stored
|
notice: Category was stored
|
||||||
|
|
Loading…
Reference in a new issue