From d3cccf81486afb4db31ae63d4eeb6f9478c024f1 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Fri, 9 Mar 2018 15:58:21 +0100 Subject: [PATCH] Add a multilingual section to the README. --- README.md | 23 ++++++++++++++++++++++- layouts/partials/language-selector.html | 5 ----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 705dce9..0d59c26 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The [old branch](https://github.com/frjo/hugo-theme-zen/tree/old) has the origin ## Sites using the Hugo Zen theme -* [Combonetwork development](https://combonet.se/) +* [Combonetwork development](https://combonet.se/) (multilingual) * [Drejargården](https://www.drejargarden.se/) * [Helmer Grundström](https://www.helmergrundstrom.se/) * [xdeb.org](https://xdeb.org/) @@ -96,6 +96,27 @@ params: ``` +## Multilingual + +English and Swedish translations are included and you can easily add more to the `i18n` site directory. + +A language selector will be included on sites with more than one language. Add a `LanguageName` parameter to your language configuration, this is what will be displayed in the selector. + +The language selector will link to a translation of the current page if it exist and to the front page if it does not. + +``` +languages: + sv: + weight: 1 + params: + LanguageName: "Svenska" + en: + weight: 2 + params: + LanguageName: "English" +``` + + ## Contact form If your server support php with the mail() command (very common) you can use the included contact form feature to get a contact form for your site. diff --git a/layouts/partials/language-selector.html b/layouts/partials/language-selector.html index 6ea49c1..c60186f 100644 --- a/layouts/partials/language-selector.html +++ b/layouts/partials/language-selector.html @@ -1,21 +1,16 @@

{{ i18n "lang_select_title" }}