浏览代码

i18n made WordCount and ReadingTime singular/plural aware

pull/363/head
Marco Kinski 4 年前
父节点
当前提交
99a0bfa099
共有 3 个文件被更改,包括 20 次插入4 次删除
  1. 9
    1
      i18n/de.toml
  2. 9
    1
      i18n/en.toml
  3. 2
    2
      layouts/_default/single.html

+ 9
- 1
i18n/de.toml 查看文件

other = "Senden" other = "Senden"


[taxonomyPageList] [taxonomyPageList]
other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”"
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"

+ 9
- 1
i18n/en.toml 查看文件

other = "Send" other = "Send"


[taxonomyPageList] [taxonomyPageList]
other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”"
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"

+ 2
- 2
layouts/_default/single.html 查看文件

3) A page front matter value is set `show_reading_time = true` 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) )}} {{ 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 }} {{ end }}
</header> </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"> <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">

正在加载...
取消
保存