From bda78fed782c89de0ed16fe0eda750f83fac88dd Mon Sep 17 00:00:00 2001
From: Danila Fedorin
Date: Wed, 12 Aug 2020 17:41:47 -0700
Subject: [PATCH] Use localization files in templates.
---
themes/vanilla/i18n/en.toml | 32 +++++++++++++++++++
themes/vanilla/layouts/blog/single.html | 4 +--
themes/vanilla/layouts/partials/header.html | 10 +++---
themes/vanilla/layouts/partials/post.html | 2 +-
.../layouts/shortcodes/numberedsidenote.html | 2 +-
.../vanilla/layouts/shortcodes/sidenote.html | 2 +-
themes/vanilla/layouts/tags/list.html | 2 +-
themes/vanilla/layouts/tags/terms.html | 2 +-
8 files changed, 44 insertions(+), 12 deletions(-)
create mode 100644 themes/vanilla/i18n/en.toml
diff --git a/themes/vanilla/i18n/en.toml b/themes/vanilla/i18n/en.toml
new file mode 100644
index 0000000..bfe03ad
--- /dev/null
+++ b/themes/vanilla/i18n/en.toml
@@ -0,0 +1,32 @@
+[Home]
+other = "Home"
+
+[About]
+other = "About"
+
+[Resume]
+other = "Resume"
+
+[Tags]
+other = "Tags"
+
+[AllPosts]
+other = "All Posts"
+
+[PostedOn]
+other = "Posted on {{ .Date.Format \"January 2, 2006\" }}."
+
+[TableOfContents]
+other = "Table of Contents"
+
+[ReadingTime]
+other = "{{ .WordCount }} words, about {{ .ReadingTime }} minutes to read."
+
+[Note]
+other = "note"
+
+[Tagged]
+other = "Tagged \"{{ .Title }}\""
+
+[AllTags]
+other = "Below is a list of all the tags ever used on this site."
diff --git a/themes/vanilla/layouts/blog/single.html b/themes/vanilla/layouts/blog/single.html
index da51380..862e0c2 100644
--- a/themes/vanilla/layouts/blog/single.html
+++ b/themes/vanilla/layouts/blog/single.html
@@ -6,14 +6,14 @@
{{ . }}
{{ end }}
- Posted on {{ .Date.Format "January 2, 2006" }}.
+ {{ i18n "PostedOn" . }}
{{ if not (eq .TableOfContents "
") }}
- Table of Contents
+ {{ i18n "TableOfContents" }}
{{ .TableOfContents }}
diff --git a/themes/vanilla/layouts/partials/header.html b/themes/vanilla/layouts/partials/header.html
index c8b046e..26be1f4 100644
--- a/themes/vanilla/layouts/partials/header.html
+++ b/themes/vanilla/layouts/partials/header.html
@@ -3,11 +3,11 @@