Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/themefisher/educenter-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2020-09-29 16:33:13 +0300
committerFrançois Revol <revol@free.fr>2020-09-29 16:33:13 +0300
commit42de1fc05d8fc1e021127593d1c7c2bfb3c0fa70 (patch)
tree289864369ed1e27ec45c68c463a8ec9d3322d426
parent6cd165064c283d86cd47ab7824d38b967852fdea (diff)
Translate menus
This simple approach reuses the i18n feature, but we currently have a collision on a name, maybe we should use some menu_ prefix in the IDs?
-rw-r--r--exampleSite/i18n/en.yaml32
-rw-r--r--exampleSite/i18n/fr.yaml32
-rwxr-xr-xlayouts/partials/header.html8
3 files changed, 66 insertions, 6 deletions
diff --git a/exampleSite/i18n/en.yaml b/exampleSite/i18n/en.yaml
index bf7cc82..c95af6a 100644
--- a/exampleSite/i18n/en.yaml
+++ b/exampleSite/i18n/en.yaml
@@ -107,4 +107,34 @@
translation: Our Teachers
- id: download
- translation: Download \ No newline at end of file
+ translation: Download
+
+- id: About
+ translation: About
+
+- id: course
+ translation: course
+
+- id: Pages
+ translation: Pages
+
+#- id: teacher
+# translation: teacher
+
+- id: notice
+ translation: notice
+
+- id: event
+ translation: event
+
+- id: scholarship
+ translation: scholarship
+
+- id: research
+ translation: research
+
+- id: blog
+ translation: blog
+
+- id: contact
+ translation: contact
diff --git a/exampleSite/i18n/fr.yaml b/exampleSite/i18n/fr.yaml
index 5715deb..b412b42 100644
--- a/exampleSite/i18n/fr.yaml
+++ b/exampleSite/i18n/fr.yaml
@@ -107,4 +107,34 @@
translation: Nos enseignants
- id: download
- translation: Télécharger \ No newline at end of file
+ translation: Télécharger
+
+- id: About
+ translation: À propos
+
+- id: course
+ translation: Cours
+
+- id: Pages
+ translation: Pages
+
+#- id: teacher
+# translation: Enseignant·e
+
+- id: notice
+ translation: notice
+
+- id: event
+ translation: Évènement
+
+- id: scholarship
+ translation: Cursus
+
+- id: research
+ translation: Recherches
+
+- id: blog
+ translation: Blog
+
+- id: contact
+ translation: Contact
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index bc34393..0901771 100755
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -44,17 +44,17 @@
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown">
- {{ .Name }}
+ {{ i18n .Name }}
</a>
<div class="dropdown-menu">
{{ range .Children }}
- <a class="dropdown-item" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
+ <a class="dropdown-item" href="{{ .URL | absLangURL }}">{{ i18n .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
- <a class="nav-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
+ <a class="nav-link" href="{{ .URL | absLangURL }}">{{ i18n .Name }}</a>
</li>
{{ end }}
{{ end }}
@@ -86,4 +86,4 @@
</div>
</div>
</header>
-<!-- /header --> \ No newline at end of file
+<!-- /header -->