From 0fbd45a05d8290f8864abed672f41076b3ac04ff Mon Sep 17 00:00:00 2001 From: BlueFox Date: Sat, 5 Apr 2025 23:15:34 +0200 Subject: [PATCH] Fixed plural-singular issue with reading time indications --- content/posts/one-word.de.md | 8 ++++++++ content/posts/one-word.en.md | 8 ++++++++ hugo.toml | 26 ++++++++++++++++++-------- layouts/_default/single.html | 2 +- layouts/partials/footer.html | 6 +++--- 5 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 content/posts/one-word.de.md create mode 100644 content/posts/one-word.en.md diff --git a/content/posts/one-word.de.md b/content/posts/one-word.de.md new file mode 100644 index 0000000..5237866 --- /dev/null +++ b/content/posts/one-word.de.md @@ -0,0 +1,8 @@ ++++ +title = 'Deutscher Test Post' +date = 2025-04-05T20:14:29+02:00 +draft = false +toc = false ++++ + +# Nureinwort diff --git a/content/posts/one-word.en.md b/content/posts/one-word.en.md new file mode 100644 index 0000000..b90f556 --- /dev/null +++ b/content/posts/one-word.en.md @@ -0,0 +1,8 @@ ++++ +title = 'English Test Post' +date = 2025-04-05T22:48:12+02:00 +draft = false +toc = false ++++ + +# Justoneword diff --git a/hugo.toml b/hugo.toml index 06007f8..adffa1f 100644 --- a/hugo.toml +++ b/hugo.toml @@ -83,7 +83,7 @@ pagination.pagerSize = 5 subtitle = "Blog of privacynerd" owner = "" keywords = "" - copyright = "© 2025 Benjamin Burkhardt" + copyright = "Benjamin Burkhardt" menuMore = "Show more" readMore = "Read more" readOtherPosts = "Read other posts" @@ -91,9 +91,14 @@ pagination.pagerSize = 5 olderPosts = "Older posts" missingContentMessage = "Page not found..." missingBackButtonLabel = "Back to home page" - minuteReadingTime = "min read" - words = "words" - imprint = "Imprint" + _minute = "minute" + _minutes = "minutes" + _readingTime = "to read" + _word = "word" + _words = "words" + _imprint = "Imprint" + _by = "by" + _customized = "customized" [languages.en.params.logo] logoText = "Privacynerd's blog" @@ -120,7 +125,7 @@ pagination.pagerSize = 5 subtitle = "Blog von privacynerd" owner = "" keywords = "" - copyright = "© 2025 Benjamin Burkhardt" + copyright = "Benjamin Burkhardt" menuMore = "Mehr zeigen" readMore = "Mehr lesen" readOtherPosts = "Andere Posts lesen" @@ -128,9 +133,14 @@ pagination.pagerSize = 5 olderPosts = "Ältere Posts" missingContentMessage = "Seite konnte nicht gefunden werden..." missingBackButtonLabel = "Zurück zur Startseite" - minuteReadingTime = "Minuten Lesezeit" - words = "Wörter" - imprint = "Impressum" + _minute = "Minute" + _minutes = "Minuten" + _readingTime = "Lesezeit" + _word = "Wort" + _words = "Wörter" + _imprint = "Impressum" + _by = "von" + _customized = "angepasst" [languages.de.params.logo] logoText = "Privacynerd's blog" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 5d008ea..739bca5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,7 +16,7 @@ {{ . }} {{- end -}} {{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}} - {{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }}) + {{ .ReadingTime }} {{ if eq .ReadingTime 1 }}{{ $.Site.Params._minute | default "minute" }}{{ else }}{{ $.Site.Params._minutes | default "minutes" }}{{ end }} {{$.Site.Params._readingTime | default "to read" }} ({{ .WordCount }} {{ if eq .WordCount 1 }}{{ $.Site.Params._word | default "word" }}{{ else }}{{ $.Site.Params._words | default "words" }}{{ end }}) {{- end -}} {{ partial "comments_counter.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ad1fa18..2cae085 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -2,13 +2,13 @@