feat: add i18n support to reading time string

This commit is contained in:
Jimmy Cai 2021-07-23 09:49:04 +00:00 committed by GitHub
parent 77395dcd6d
commit f2b9e33495
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,11 @@ article:
lastUpdatedOn: lastUpdatedOn:
other: Last updated on other: Last updated on
readingTime:
one: "{{ .Count }} min read"
### Seems that there's no need to add 's' even if it's plural in English
other: "{{ .Count }} min read"
notFound: notFound:
title: title:
other: Not Found other: Not Found

View File

@ -35,7 +35,7 @@
<div> <div>
{{ partial "helper/icon" "clock" }} {{ partial "helper/icon" "clock" }}
<time class="article-time--reading"> <time class="article-time--reading">
{{ .ReadingTime }} min read {{ T "article.readingTime" .ReadingTime }}
</time> </time>
</div> </div>
{{ end }} {{ end }}