From 8e54760d2ec1e5f8a4fc9937b8e196c29adbb7f6 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Fri, 17 Apr 2015 13:55:44 -0300 Subject: [PATCH] Translations for ownership authentication --- app/controllers/concerns/ownership_authentication.rb | 6 +++--- config/locales/controllers/concerns/en.yml | 3 +++ config/locales/controllers/concerns/pt.yml | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 config/locales/controllers/concerns/en.yml create mode 100644 config/locales/controllers/concerns/pt.yml diff --git a/app/controllers/concerns/ownership_authentication.rb b/app/controllers/concerns/ownership_authentication.rb index cdb1db0..f210967 100644 --- a/app/controllers/concerns/ownership_authentication.rb +++ b/app/controllers/concerns/ownership_authentication.rb @@ -54,7 +54,7 @@ module OwnershipAuthentication def check_project_ownership(id) if current_user.project_attributes.find_by_project_id(id).nil? respond_to do |format| - format.html { redirect_to projects_url, notice: "You're not allowed to do this operation" } + format.html { redirect_to projects_url, notice: t('not_allowed') } format.json { head :no_content } end end @@ -65,7 +65,7 @@ module OwnershipAuthentication def check_reading_group_ownership(id) if current_user.reading_group_ownerships.find_by_reading_group_id(id).nil? respond_to do |format| - format.html { redirect_to reading_group_url(id: id), notice: "You're not allowed to do this operation" } + format.html { redirect_to reading_group_url(id: id), notice: t('not_allowed') } format.json { head :no_content } end end @@ -76,7 +76,7 @@ module OwnershipAuthentication def check_kalibro_configuration_ownership(id) if current_user.kalibro_configuration_ownerships.find_by_kalibro_configuration_id(id).nil? respond_to do |format| - format.html { redirect_to kalibro_configurations_url(id: id), notice: "You're not allowed to do this operation" } + format.html { redirect_to kalibro_configurations_url(id: id), notice: t('not_allowed') } format.json { head :no_content } end end diff --git a/config/locales/controllers/concerns/en.yml b/config/locales/controllers/concerns/en.yml new file mode 100644 index 0000000..541a15e --- /dev/null +++ b/config/locales/controllers/concerns/en.yml @@ -0,0 +1,3 @@ +--- +en: + not_allowed: "You're not allowed to do this operation" diff --git a/config/locales/controllers/concerns/pt.yml b/config/locales/controllers/concerns/pt.yml new file mode 100644 index 0000000..eaa1849 --- /dev/null +++ b/config/locales/controllers/concerns/pt.yml @@ -0,0 +1,3 @@ +--- +pt: + not_allowed: "Você não está autorizado a fazer esta operação" -- libgit2 0.21.2