From e56f50a91bae55034d3fbf57482bbfcb4462baa7 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Thu, 8 Mar 2018 14:30:22 +0100 Subject: [PATCH] Added a language selector. --- i18n/en.toml | 42 ++++++++++++++++++++++++ i18n/sv.toml | 42 ++++++++++++++++++++++++ layouts/_default/baseof.html | 9 +++-- layouts/partials/language-selector.html | 21 ++++++++++++ layouts/partials/menu.html | 2 +- sass/_zen.scss | 20 +++++++++++ sass/navigation/mobile/_mobile.scss | 10 +++--- static/css/styles.css | 2 +- static/images/language-icon.png | Bin 0 -> 2673 bytes 9 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 layouts/partials/language-selector.html create mode 100755 static/images/language-icon.png diff --git a/i18n/en.toml b/i18n/en.toml index 229104e..783fec6 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -39,3 +39,45 @@ other = "on" [string_recent_content] other = "Recent content" + +[contact_js] +other = "You must have Javascript enabled to use this contact form." + +[contact_submitted] +other = "Your message was sent." + +[contact_error] +other = "There was an error sending the message." + +[contact_name] +other = "Name" + +[contact_name_placeholder] +other = "Your name" + +[contact_mail] +other = "E-mail address" + +[contact_mail_placeholder] +other = "Your e-mail address" + +[contact_subject] +other = "Subject" + +[contact_subject_placeholder] +other = "A short subject" + +[contact_message] +other = "Message" + +[contact_message_placeholder] +other = "The messages goes here…" + +[contact_submit] +other = "Send message" + +[contact_honypot] +other = "Skip if you are a human" + +[lang_select_title] +other = "Language selector" diff --git a/i18n/sv.toml b/i18n/sv.toml index d017906..556247d 100644 --- a/i18n/sv.toml +++ b/i18n/sv.toml @@ -39,3 +39,45 @@ other = "på" [string_recent_content] other = "Senaste innehåll" + +[contact_js] +other = "Du behöver ha Javascript aktiverat för att använda detta kontaktformulär." + +[contact_submitted] +other = "Ditt meddelande har skickats." + +[contact_error] +other = "Det blev ett fel när meddelandet skickades." + +[contact_name] +other = "Namn" + +[contact_name_placeholder] +other = "Ditt namn" + +[contact_mail] +other = "E-postadress" + +[contact_mail_placeholder] +other = "Din e-postadress" + +[contact_subject] +other = "Rubrik" + +[contact_subject_placeholder] +other = "En kort rubrik" + +[contact_message] +other = "Meddelande" + +[contact_message_placeholder] +other = "Meddelandet skrivs här…" + +[contact_submit] +other = "Skicka meddelande" + +[contact_honypot] +other = "Hoppa över ifall du är människa." + +[lang_select_title] +other = "Språkväljare" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b7ebf0e..2897ab6 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,11 +14,14 @@
{{ partial "menu.html" . }} diff --git a/layouts/partials/language-selector.html b/layouts/partials/language-selector.html new file mode 100644 index 0000000..6ea49c1 --- /dev/null +++ b/layouts/partials/language-selector.html @@ -0,0 +1,21 @@ +

{{ i18n "lang_select_title" }}

+ diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 666e1d8..695de54 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -1,4 +1,4 @@ -{{ $home := relURL "/" }} +{{ $home := relLangURL "/" }} {{ $currentSection := .Section }} {{ $currentID := .UniqueID }}