From cb554f8bd9f5311fead48755068bdcf963e242c9 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 27 Jan 2023 15:00:36 +0100
Subject: [PATCH] Proper titles

---
 app/views/devise/confirmations/new.html.erb |  2 ++
 app/views/devise/passwords/edit.html.erb    |  2 ++
 app/views/devise/passwords/new.html.erb     |  2 ++
 app/views/devise/registrations/new.html.erb |  2 ++
 app/views/devise/sessions/new.html.erb      |  2 +-
 app/views/devise/unlocks/new.html.erb       |  2 ++
 config/locales/devise.en.yml                | 21 +++++++++++++++++++++
 config/locales/devise.fr.yml                | 21 +++++++++++++++++++++
 8 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 config/locales/devise.en.yml
 create mode 100644 config/locales/devise.fr.yml

diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb
index e0413b713..4d24f697b 100644
--- a/app/views/devise/confirmations/new.html.erb
+++ b/app/views/devise/confirmations/new.html.erb
@@ -1,3 +1,5 @@
+<%= content_for :title, t('.title') %>
+
 <h2 class="mb-4"><%= t(".resend_confirmation_instructions") %></h2>
 
 <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb
index 91f5153e6..44071e8c9 100644
--- a/app/views/devise/passwords/edit.html.erb
+++ b/app/views/devise/passwords/edit.html.erb
@@ -1,3 +1,5 @@
+<%= content_for :title, t('.title') %>
+
 <h2 class="mb-4"><%= t(".change_your_password") %></h2>
 
 <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb
index 6a2608462..0a10d6323 100644
--- a/app/views/devise/passwords/new.html.erb
+++ b/app/views/devise/passwords/new.html.erb
@@ -1,3 +1,5 @@
+<%= content_for :title, t('.title') %>
+
 <h2 class="mb-4"><%= t(".forgot_your_password") %></h2>
 
 <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb
index a8502cf95..34db524df 100644
--- a/app/views/devise/registrations/new.html.erb
+++ b/app/views/devise/registrations/new.html.erb
@@ -1,3 +1,5 @@
+<%= content_for :title, t('.title') %>
+
 <h2 class="mb-4"><%= t(".sign_up") %></h2>
 
 <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index 2fe19417c..b88f05d8d 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -1,4 +1,4 @@
-<%= content_for :title, 'Osuny' %>
+<%= content_for :title, t('.title') %>
 
 <div class="row">
   <div class="col-md-6 mb-5">
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb
index 75388e556..1035f065a 100644
--- a/app/views/devise/unlocks/new.html.erb
+++ b/app/views/devise/unlocks/new.html.erb
@@ -1,3 +1,5 @@
+<%= content_for :title, t('.title') %>
+
 <h2 class="mb-4"><%= t(".resend_unlock_instructions") %></h2>
 
 <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
new file mode 100644
index 000000000..df07a0b52
--- /dev/null
+++ b/config/locales/devise.en.yml
@@ -0,0 +1,21 @@
+en:
+  devise:
+    confirmations:
+      new:
+        title: Account confirmation
+    passwords:
+      edit:
+        new: Password change
+      new:
+        title: Password forgotton
+    registrations:
+      edit:
+        title: Account edition
+      new: 
+        title: Register on Osuny
+    sessions:
+      new:
+        title: Welcome to Osuny
+    unlocks:
+      new:
+        title: Account unlocking
diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml
new file mode 100644
index 000000000..9c4e4fb7c
--- /dev/null
+++ b/config/locales/devise.fr.yml
@@ -0,0 +1,21 @@
+fr:
+  devise:
+    confirmations:
+      new:
+        title: Confirmation de compte
+    passwords:
+      edit:
+        new: Changement de mot de passe
+      new:
+        title: Mot de passe oublié
+    registrations:
+      edit:
+        title: Modification de votre compte
+      new: 
+        title: Inscription sur Osuny
+    sessions:
+      new:
+        title: Bienvenue sur Osuny
+    unlocks:
+      new:
+        title: Déblocage de compte
-- 
GitLab