From 775277039eab2161823621329902622b1cc17a23 Mon Sep 17 00:00:00 2001 From: Marco Kinski Date: Fri, 1 Oct 2021 19:23:28 +0200 Subject: [PATCH] i18n made WordCount and ReadingTime singular/plural aware (#363) Co-authored-by: Regis Philibert --- i18n/de.toml | 8 ++++++++ i18n/en.toml | 10 +++++++++- layouts/_default/single.html | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/i18n/de.toml b/i18n/de.toml index 11c8fdb..d54cf08 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -34,5 +34,13 @@ other = "Senden" [taxonomyPageList] other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”" +[readingTime] +one = "Eine Minute" +other = "{{ .Count }} Minuten" + +[wordCount] +one = "Ein Wort" +other = "{{ .Count }} Wörter" + [pageTitle] other = "{{ .Name }} Seite" \ No newline at end of file diff --git a/i18n/en.toml b/i18n/en.toml index 5adbe27..755e3b0 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -34,5 +34,13 @@ other = "Send" [taxonomyPageList] other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”" +[readingTime] +one = "One minute read" +other = "{{ .Count }} minutes read" + +[wordCount] +one = "One word" +other = "{{ .Count }} words" + [pageTitle] -other = "{{ .Name }} page" \ No newline at end of file +other = "{{ .Name }} page" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2f2eed3..0c7b97b 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -43,8 +43,8 @@ 3) A page front matter value is set `show_reading_time = true` */}} {{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}} - - {{ .ReadingTime}} minutes read - - {{ .WordCount}} words + - {{ i18n "readingTime" .ReadingTime }} + - {{ i18n "wordCount" .WordCount }} {{ end }}