From d95024dca8bd476dc5e116b9f252988a719ad660 Mon Sep 17 00:00:00 2001 From: Maximilien Bausson Date: Thu, 12 Oct 2023 16:18:49 +0200 Subject: [PATCH] Added translations for stack resource --- app/controllers/stacks_controller.rb | 6 +++--- app/views/stacks/_form.html.erb | 14 +++++++++----- app/views/stacks/edit.html.erb | 2 +- app/views/stacks/index.html.erb | 27 ++++++++++++++++++--------- app/views/stacks/new.html.erb | 6 ++++-- app/views/stacks/show.html.erb | 16 +++++++++++----- config/locales/activerecord.fr.yml | 6 ++++++ config/locales/fr.yml | 22 ++++++++++++++++++++++ 8 files changed, 74 insertions(+), 25 deletions(-) diff --git a/app/controllers/stacks_controller.rb b/app/controllers/stacks_controller.rb index f59be88ea..9fa05d614 100644 --- a/app/controllers/stacks_controller.rb +++ b/app/controllers/stacks_controller.rb @@ -28,7 +28,7 @@ def create respond_to do |format| if @stack.save - format.html { redirect_to stacks_path, notice: 'Stack was successfully created.' } + format.html { redirect_to stacks_path, notice: t(".flashes.created") } format.json { render :show, status: :created, location: @stack } else format.html { render :new } @@ -42,7 +42,7 @@ def create def update respond_to do |format| if @stack.update(stack_params) - format.html { redirect_to stacks_path, notice: 'Stack was successfully updated.' } + format.html { redirect_to stacks_path, notice: t(".flashes.updated") } format.json { render :show, status: :ok, location: @stack } else format.html { render :edit } @@ -56,7 +56,7 @@ def update def destroy if @stack.destroy respond_to do |format| - format.html { redirect_to stacks_url, notice: 'Stack a bien été supprimé.' } + format.html { redirect_to stacks_url, notice: t(".flashes.destroyed") } format.json { head :no_content } end else diff --git a/app/views/stacks/_form.html.erb b/app/views/stacks/_form.html.erb index d334f5407..780c5d1dc 100644 --- a/app/views/stacks/_form.html.erb +++ b/app/views/stacks/_form.html.erb @@ -1,8 +1,12 @@ <%= form_for(@stack, html: { class: "form-horizontal", role: "form" }) do |f| %> <% if @stack.errors.any? %>