diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb index d4aee9e51cf831e20da805bc0db77e8362173dd3..fd8ca3a098e7745f3b1dbaf67f006f3e7cdaed41 100644 --- a/app/controllers/collections_controller.rb +++ b/app/controllers/collections_controller.rb @@ -60,7 +60,7 @@ class CollectionsController < ApplicationController respond_to do |format| if @collection.save - format.html { redirect_to :back, notice: 'Coleção criada com sucesso.' } + format.html { redirect_to :back, notice: t('activerecord.attributes.collection.create.notice.successfully_created') } else format.html { render :new } end @@ -72,7 +72,7 @@ class CollectionsController < ApplicationController def update respond_to do |format| if Collection.update(collection_params) - format.html { redirect_to @collection, notice: 'Coleção atualizada com sucesso.' } + format.html { redirect_to @collection, notice: t('activerecord.attributes.collection.update.notice.successfully_updated') } else format.html { render :edit } end @@ -85,7 +85,7 @@ class CollectionsController < ApplicationController Collection.destroy @collection respond_to do |format| - format.html { redirect_to user_path(current_user), notice: 'Coleção excluida com sucesso.' } + format.html { redirect_to user_path(current_user), notice: t('activerecord.attributes.collection.destroy.notice.successfully_destroy') } end end diff --git a/app/controllers/complaints_controller.rb b/app/controllers/complaints_controller.rb index c83724f235e47114724a38f375de20f7dda1fd5a..bce93bf58ff02431fb257176c415a6d8168e5e3b 100644 --- a/app/controllers/complaints_controller.rb +++ b/app/controllers/complaints_controller.rb @@ -10,9 +10,9 @@ class ComplaintsController < ApplicationController respond_to do |format| if complaint.save - format.html { redirect_to :back, notice: 'Denúncia realizada com sucesso.' } + format.html { redirect_to :back, notice: t('activerecord.attributes.complaint.create.notice.sucess') } else - format.html { redirect_to :back, alert: 'Objeto já foi denunciado por você.' } + format.html { redirect_to :back, alert: t('activerecord.attributes.complaint.create.alert.fail') } end end end diff --git a/app/controllers/feedbacks_controller.rb b/app/controllers/feedbacks_controller.rb index e511d602599c0ec74b0e08ed4fc9bde4f2cabe38..bf391b700c3b8f13aff4b4a7ec5228b46c51c575 100644 --- a/app/controllers/feedbacks_controller.rb +++ b/app/controllers/feedbacks_controller.rb @@ -32,7 +32,7 @@ class FeedbacksController < ApplicationController respond_to do |format| if feedback_service.report_bug @bug - format.html { redirect_to :back, notice: 'Problema relatado com sucesso!' } + format.html { redirect_to :back, notice: t('activerecord.attributes.feedback.report_bug.notice.success') } end end end diff --git a/app/controllers/learning_objects_controller.rb b/app/controllers/learning_objects_controller.rb index 2a492b4e52cdb6dadf9837e8511181ac8980197a..0f40b94dcad9e3e51fe9dd8039fee346e8ca4341 100644 --- a/app/controllers/learning_objects_controller.rb +++ b/app/controllers/learning_objects_controller.rb @@ -40,7 +40,7 @@ class LearningObjectsController < ApplicationController # go to file submission page format.html { success_redirect @learning_object } else - format.html { render :new, notice: 'Não foi possÃvel criar o objeto.' } + format.html { render :new, notice: t('activerecord.attributes.learning_object.create.notice.failure') } end end @@ -64,7 +64,7 @@ class LearningObjectsController < ApplicationController LearningObject.destroy @learning_object respond_to do |format| - format.html { redirect_to learning_objects_url, notice: 'Objeto educacional excluÃdo com sucesso.' } + format.html { redirect_to learning_objects_url, notice: t('activerecord.attributes.learning_object.destroy.notice.successfully_destroy') } end end @@ -121,7 +121,7 @@ class LearningObjectsController < ApplicationController def success_redirect(learning_object) #if 'Website externo' == learning_object.object_type.name - redirect_to learning_object_build_path(learning_object, :upload_attachments), notice: 'Seu objeto foi criado com sucesso!' + redirect_to learning_object_build_path(learning_object, :upload_attachments), notice: t('activerecord.attributes.learning_object.success_redirect.notice.successfully_created') end def set_form_objects diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 6670a9dce73ce690f231b3b0dd5391d8acffee83..89aaf5fd827219effbf58f3b161ed19038174f84 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -137,8 +137,45 @@ pt-BR: object_type: "Tipo do objeto" language: "Idioma" author: "Autor" + create: + notice: + failure: "Não foi possÃvel criar o objeto." + destroy: + notice: + successfully_destroy: "Objeto educacional excluÃdo com sucesso." + success_redirect: + notice: + successfully_created: "Seu objeto educacional foi criado com sucesso!" + collection: + create: + notice: + successfully_created: "Coleção criada com sucesso." + update: + notice: + sucessfully_updated: "Coleção atualizada com sucesso." + destroy: + notice: + successfully_destroy: "Coleção excluÃda com sucesso." + complaint: + create: + notice: + sucess: "Denúncia realizada com sucesso." + alert: + fail: "Objeto já foi denunciado por você." + feedback: + report_bug: + notice: + sucess: "Problema relatado com sucesso!" institution: - name: "Nome" + create: + notice: + successfully_created: "Instituição criada com sucesso." + update: + notice: + sucessfully_updated: "Instituição atualizada com sucesso." + destroy: + notice: + successfully_destroy: "Instituição excluÃda com sucesso." review: create: notice: