From 062e98cad782e72ae65b44cea5622f6b57e752e5 Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Fri, 16 Dec 2022 10:54:22 +0100
Subject: [PATCH] cleanup i18n

---
 i18n/en.yml                                 | 31 +++++++++------------
 i18n/fr.yml                                 | 31 +++++++++------------
 layouts/partials/programs/admission.html    | 12 ++++----
 layouts/partials/programs/pedagogy.html     | 10 +++----
 layouts/partials/programs/presentation.html |  4 +--
 layouts/partials/programs/results.html      |  4 +--
 layouts/partials/programs/toc.html          | 16 +++++++++--
 7 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/i18n/en.yml b/i18n/en.yml
index 49492cc9..b5a6b2ad 100644
--- a/i18n/en.yml
+++ b/i18n/en.yml
@@ -122,25 +122,20 @@ posts:
   share_aria: Share on “{{ .Title }}” - extern link
   title: News
 programs:
-  _accessibility: Accessibility
-  _administrative_information: Administrative information
-  _contacts: Contacts
-  _duration: Duration
-  _description: Description
-  _informations: Informations
-  _evaluation: Evaluation
-  _objectives: Objectives
-  _opportunities: Opportunities
+  accessibility: Accessibility
+  administrative_information: Administrative information
+  contacts: Contacts
+  evaluation: Evaluation
+  opportunities: Opportunities
   _other: Other
-  _pedagogy: Pedagogy
-  _prerequisites: Prerequisites
-  _pricing: Pricing
-  _registration: Registration
-  _roles: Roles
-  _teachers: Teachers
-  _team: Team
-  _content: Content
-  _results: Results
+  pedagogy: Pedagogy
+  prerequisites: Prerequisites
+  pricing: Pricing
+  registration: Registration
+  roles: Roles
+  teachers: Teachers
+  content: Content
+  results: Results
   apply: Apply
   capacity: Capacity
   diploma: Diploma
diff --git a/i18n/fr.yml b/i18n/fr.yml
index b5d20f9f..be465580 100644
--- a/i18n/fr.yml
+++ b/i18n/fr.yml
@@ -122,25 +122,20 @@ posts:
   share_aria: Partager sur “{{ .Title }}” - lien externe
   title: Actualités
 programs:
-  _accessibility: Accessibilité
-  _administrative_information: Informations administratives
-  _contacts: Contacts
-  _duration: Durée
-  _description: Description
-  _informations: Informations
-  _evaluation: Modalités d’évaluation
-  _objectives: Objectifs
-  _opportunities: Débouchés
+  accessibility: Accessibilité
+  administrative_information: Informations administratives
+  contacts: Contacts
+  evaluation: Modalités d’évaluation
+  opportunities: Débouchés
   _other: Autre
-  _pedagogy: Méthodes mobilisées
-  _prerequisites: Prérequis
-  _pricing: Tarifs
-  _registration: Modalités et délais d’accès
-  _roles: Rôles
-  _teachers: Enseignants·es
-  _team: Équipe
-  _content: Contenus de la formation
-  _results: Indicateurs de résultats
+  pedagogy: Méthodes mobilisées
+  prerequisites: Prérequis
+  pricing: Tarifs
+  registration: Modalités et délais d’accès
+  roles: Rôles
+  teachers: Enseignants·es
+  content: Contenus de la formation
+  results: Indicateurs de résultats
   apply: Candidater
   capacity: Capacité d’accueil
   diploma: Diplôme
diff --git a/layouts/partials/programs/admission.html b/layouts/partials/programs/admission.html
index b29e7019..eb002289 100644
--- a/layouts/partials/programs/admission.html
+++ b/layouts/partials/programs/admission.html
@@ -5,17 +5,17 @@
       <h2>{{ i18n "programs.toc.admission" }}</h2>
       <div>
         {{- if partial "GetTextFromHTML" .Params.prerequisites -}}
-          <h3>{{ i18n "programs._prerequisites" }}</h3>
+          <h3>{{ i18n "programs.prerequisites" }}</h3>
           {{- partial "PrepareHTML" .Params.prerequisites -}}
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.pricing -}}
-          <h3>{{ i18n "programs._pricing" }}</h3>
+          <h3>{{ i18n "programs.pricing" }}</h3>
           {{- partial "PrepareHTML" .Params.pricing -}}
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.registration -}}
-          <h3>{{ i18n "programs._registration" }}</h3>
+          <h3>{{ i18n "programs.registration" }}</h3>
           {{- partial "PrepareHTML" .Params.registration -}}
           {{- if partial "GetTextFromHTML" .Params.registration_url -}}
             <p><a href="{{- partial "PrepareHTML" .Params.registration_url -}}" class="registration">{{ i18n "programs.apply" }}</a></p>
@@ -23,7 +23,7 @@
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.accessibility -}}
-          <h3>{{ i18n "programs._accessibility" }}</h3>
+          <h3>{{ i18n "programs.accessibility" }}</h3>
           {{- partial "PrepareHTML" .Params.accessibility -}}
         {{- end -}}
 
@@ -34,7 +34,7 @@
 
         {{- if .Params.roles -}}
 
-          <h3>{{ i18n "programs._roles" }}</h3>
+          <h3>{{ i18n "programs.roles" }}</h3>
           {{- with .Params.roles -}}
             {{- range . }}
               {{ $title := .title }}
@@ -63,7 +63,7 @@
         {{- end -}}
 
         {{- if  partial "GetTextFromHTML" .Params.contacts -}}
-          <h3>{{ i18n "programs._contacts" }}</h3>
+          <h3>{{ i18n "programs.contacts" }}</h3>
           {{- if or (partial "GetTextFromHTML" .Params.contacts) -}}
             {{- partial "PrepareHTML" .Params.contacts -}}
           {{- end -}}
diff --git a/layouts/partials/programs/pedagogy.html b/layouts/partials/programs/pedagogy.html
index 04525c53..fcd6596f 100644
--- a/layouts/partials/programs/pedagogy.html
+++ b/layouts/partials/programs/pedagogy.html
@@ -5,23 +5,23 @@
       <h2>{{ i18n "programs.toc.pedagogy" }}</h2>
       <div>
         {{- if partial "GetTextFromHTML" .Params.content -}}
-          <h3>{{ i18n "programs._content" }}</h3>
+          <h3 id="{{ anchorize (i18n "programs.content") }}">{{ i18n "programs.content" }}</h3>
           {{- partial "PrepareHTML" .Params.content -}}
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.pedagogy -}}
-          <h3>{{ i18n "programs._pedagogy" }}</h3>
+          <h3 id="{{ anchorize (i18n "programs.pedagogy") }}">{{ i18n "programs.pedagogy" }}</h3>
           {{- partial "PrepareHTML" .Params.pedagogy -}}
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.evaluation -}}
-          <h3>{{ i18n "programs._evaluation" }}</h3>
+          <h3 id="{{ anchorize (i18n "programs.evaluation") }}">{{ i18n "programs.evaluation" }}</h3>
           {{- partial "PrepareHTML" .Params.evaluation -}}
         {{- end -}}
 
         {{- if .Params.teachers -}}
-          {{ $title := i18n "programs._teachers" -}}
-          <h3>{{ $title }}</h3>
+          {{ $title := i18n "programs.teachers" -}}
+          <h3 id="{{ anchorize $title }}">{{ $title }}</h3>
           {{- partial "programs/teachers.html"
                         (dict
                           "title" $title
diff --git a/layouts/partials/programs/presentation.html b/layouts/partials/programs/presentation.html
index 8209e128..025f36c1 100644
--- a/layouts/partials/programs/presentation.html
+++ b/layouts/partials/programs/presentation.html
@@ -9,9 +9,9 @@
             {{- partial "PrepareHTML" .Params.objectives -}}
           {{- end -}}
 
-          <h3>{{ i18n "programs._administrative_information" }}</h3>
+          <h3 id="{{ anchorize (i18n "programs.administrative_information") }}">{{ i18n "programs.administrative_information" }}</h3>
           <table class="post-infos">
-            <caption>{{ i18n "programs._administrative_information" }}</caption>
+            <caption>{{ i18n "programs.administrative_information" }}</caption>
             <tbody>
               {{- with .Params.diplomas -}}
                 {{- $diploma := site.GetPage (printf "/diplomas/%s" .) -}}
diff --git a/layouts/partials/programs/results.html b/layouts/partials/programs/results.html
index 57be24af..09eb2e70 100644
--- a/layouts/partials/programs/results.html
+++ b/layouts/partials/programs/results.html
@@ -5,12 +5,12 @@
       <h2>{{ i18n "programs.toc.results" }}</h2>
       <div>
         {{- if partial "GetTextFromHTML" .Params.opportunities -}}
-          <h3>{{ i18n "programs._opportunities" }}</h3>
+          <h3>{{ i18n "programs.opportunities" }}</h3>
           {{- partial "PrepareHTML" .Params.opportunities -}}
         {{- end -}}
 
         {{- if partial "GetTextFromHTML" .Params.results -}}
-          <h3>{{ i18n "programs._results" }}</h3>
+          <h3>{{ i18n "programs.results" }}</h3>
           {{- partial "PrepareHTML" .Params.results -}}
         {{- end -}}
       </div>
diff --git a/layouts/partials/programs/toc.html b/layouts/partials/programs/toc.html
index da07a95a..c880a04e 100644
--- a/layouts/partials/programs/toc.html
+++ b/layouts/partials/programs/toc.html
@@ -1,3 +1,7 @@
+{{ $pedagogy := (dict 
+
+  )}}
+
 {{/* nav-link required for toggle active class */}}
 <nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}">
   <ol>
@@ -6,14 +10,20 @@
     </li>
     <li>
       <a href="#presentation">{{ i18n "programs.toc.presentation" }}</a>
-      {{- if .context.Params.blocks -}}
-        <ol>
+       <ol>
+          <li><a href="#{{ anchorize (i18n "programs.administrative_information") }}">{{ i18n "programs.administrative_information" }}</a></li>
+          {{- if .context.Params.blocks -}}
           {{- partial "blocks/toc" .context.Params.blocks -}}
+          {{- end -}}
         </ol>
-      {{- end -}}
     </li>
     <li>
       <a href="#pedagogy">{{ i18n "programs.toc.pedagogy" }}</a>
+      <ol>
+        {{- if partial "GetTextFromHTML" .context.Params.content -}}
+          <li><a href="#{{ anchorize (i18n "programs.content") }}">{{ i18n "programs.content" }}</a></li>
+        {{- end -}}
+      </ol>
     </li>
     <li>
       <a href="#results">{{ i18n "programs.toc.results" }}</a>
-- 
GitLab