From 889cd3b1a88be773b81df4120cec6cb82bb810c7 Mon Sep 17 00:00:00 2001
From: Raoul
Date: Mon, 23 Apr 2018 18:13:15 +0200
Subject: [PATCH] Language selector
---
config.toml | 17 +++++++++++++++++
.../layouts/partials/site-sidebar.html | 10 ++++++++++
2 files changed, 27 insertions(+)
diff --git a/config.toml b/config.toml
index 577f554..47f181a 100644
--- a/config.toml
+++ b/config.toml
@@ -10,12 +10,29 @@ DefaultContentLanguageInSubdir = true
[Languages]
[Languages.de]
weight = 1
+ languageNames = {de = "Deutsch",
+ fr = "Französisch",
+ it = "Italienisch",
+ en = "Englisch"}
[Languages.fr]
weight = 2
+ languageNames = {de = "Allemand",
+ fr = "Français",
+ it = "Italien",
+ en = "Anglais"}
[Languages.it]
weight = 3
+ languageNames = {de = "Tedesco",
+ fr = "Francese ",
+ it = "Italiano",
+ en = "Inglese"}
+
[Languages.en]
weight = 4
+ languageNames = {de = "German",
+ fr = "French",
+ it = "Italian",
+ en = "English"}
diff --git a/themes/cosin-theme/layouts/partials/site-sidebar.html b/themes/cosin-theme/layouts/partials/site-sidebar.html
index fe5e962..e6f0f57 100644
--- a/themes/cosin-theme/layouts/partials/site-sidebar.html
+++ b/themes/cosin-theme/layouts/partials/site-sidebar.html
@@ -52,4 +52,14 @@
{{ end }}
+
+
+ Sprache:
+ {{ if .IsTranslated }}
+ {{ range .Translations }}
+ {{ index .Site.Params.languageNames .Lang }}
+ {{ end }}
+ {{ end }}
+
+