Commit 8e54760d2ec1e5f8a4fc9937b8e196c29adbb7f6

Authored by Heitor
1 parent 4cfb71b9

Translations for ownership authentication

app/controllers/concerns/ownership_authentication.rb
@@ -54,7 +54,7 @@ module OwnershipAuthentication @@ -54,7 +54,7 @@ module OwnershipAuthentication
54 def check_project_ownership(id) 54 def check_project_ownership(id)
55 if current_user.project_attributes.find_by_project_id(id).nil? 55 if current_user.project_attributes.find_by_project_id(id).nil?
56 respond_to do |format| 56 respond_to do |format|
57 - format.html { redirect_to projects_url, notice: "You're not allowed to do this operation" } 57 + format.html { redirect_to projects_url, notice: t('not_allowed') }
58 format.json { head :no_content } 58 format.json { head :no_content }
59 end 59 end
60 end 60 end
@@ -65,7 +65,7 @@ module OwnershipAuthentication @@ -65,7 +65,7 @@ module OwnershipAuthentication
65 def check_reading_group_ownership(id) 65 def check_reading_group_ownership(id)
66 if current_user.reading_group_ownerships.find_by_reading_group_id(id).nil? 66 if current_user.reading_group_ownerships.find_by_reading_group_id(id).nil?
67 respond_to do |format| 67 respond_to do |format|
68 - format.html { redirect_to reading_group_url(id: id), notice: "You're not allowed to do this operation" } 68 + format.html { redirect_to reading_group_url(id: id), notice: t('not_allowed') }
69 format.json { head :no_content } 69 format.json { head :no_content }
70 end 70 end
71 end 71 end
@@ -76,7 +76,7 @@ module OwnershipAuthentication @@ -76,7 +76,7 @@ module OwnershipAuthentication
76 def check_kalibro_configuration_ownership(id) 76 def check_kalibro_configuration_ownership(id)
77 if current_user.kalibro_configuration_ownerships.find_by_kalibro_configuration_id(id).nil? 77 if current_user.kalibro_configuration_ownerships.find_by_kalibro_configuration_id(id).nil?
78 respond_to do |format| 78 respond_to do |format|
79 - format.html { redirect_to kalibro_configurations_url(id: id), notice: "You're not allowed to do this operation" } 79 + format.html { redirect_to kalibro_configurations_url(id: id), notice: t('not_allowed') }
80 format.json { head :no_content } 80 format.json { head :no_content }
81 end 81 end
82 end 82 end
config/locales/controllers/concerns/en.yml 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +---
  2 +en:
  3 + not_allowed: "You're not allowed to do this operation"
config/locales/controllers/concerns/pt.yml 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +---
  2 +pt:
  3 + not_allowed: "Você não está autorizado a fazer esta operação"