Skip to content

Commit

Permalink
Pass .WordCount to i18n function
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardbyron committed Dec 17, 2021
1 parent 75efd95 commit 26221bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} mins"
reading_time_title: "Reading time"
word_count_unit: "Words"
word_count:
one: "{{ .Count }} word"
other: "{{ .Count }} words"

author:
byline_title: "Author"
Expand Down
4 changes: 3 additions & 1 deletion i18n/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ article:
reading_time:
other: "{{ .Count }} 分钟"
reading_time_title: "预计阅读"
word_count_unit: ""
word_count:
one: "{{ .Count }} 字"
other: "{{ .Count }} 字"

author:
byline_title: "作者"
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta/word-count.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span>
{{ .WordCount }} {{- i18n "article.word_count_unit" -}}
{{- i18n "article.word_count" .WordCount | emojify -}}
</span>
{{- /* Trim EOF */ -}}

0 comments on commit 26221bc

Please sign in to comment.