mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Marco Kinski
01.23.2021 775277039eab2161823621329902622b1cc17a23
i18n made WordCount and ReadingTime singular/plural aware (#363)

Co-authored-by: Regis Philibert <login@regisphilibert.com>
3 files modified
22 ■■■■ changed files
i18n/de.toml 8 ●●●●● patch | view | raw | blame | history
i18n/en.toml 10 ●●●●● patch | view | raw | blame | history
layouts/_default/single.html 4 ●●●● patch | view | raw | blame | history
i18n/de.toml
@@ -34,5 +34,13 @@
[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"
i18n/en.toml
@@ -34,5 +34,13 @@
[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"
other = "{{ .Name }} page"
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) )}}
        <span class="f6 mv4 dib tracked"> - {{ .ReadingTime}} minutes read</span>
        <span class="f6 mv4 dib tracked"> - {{ .WordCount}} words</span>
        <span class="f6 mv4 dib tracked"> - {{ i18n "readingTime" .ReadingTime }} </span>
        <span class="f6 mv4 dib tracked"> - {{ i18n "wordCount" .WordCount }} </span>
      {{ end }}
    </header>
    <div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes"  | default "serif"}} f4 nested-links nested-img mid-gray pr4-l w-two-thirds-l">