From b4cbe9122b8d1ae34b239a52416f271abb411032 Mon Sep 17 00:00:00 2001 From: wizardbyron <1400427+wizardbyron@users.noreply.github.com> Date: Fri, 17 Dec 2021 09:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Pass=20.WordCount=20to=20i18n=20?= =?UTF-8?q?function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/en.yaml | 4 +++- i18n/zh.yaml | 4 +++- layouts/partials/meta/word-count.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/i18n/en.yaml b/i18n/en.yaml index d8de5fee..6cb5c3d5 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -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" diff --git a/i18n/zh.yaml b/i18n/zh.yaml index a539072d..ec93aa7e 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -5,7 +5,9 @@ article: reading_time: other: "{{ .Count }} 分钟" reading_time_title: "预计阅读" - word_count_unit: "字" + word_count: + one: "{{ .Count }} 字" + other: "{{ .Count }} 字" author: byline_title: "作者" diff --git a/layouts/partials/meta/word-count.html b/layouts/partials/meta/word-count.html index 6907581d..e68ec0d6 100644 --- a/layouts/partials/meta/word-count.html +++ b/layouts/partials/meta/word-count.html @@ -1,5 +1,5 @@ - {{ .WordCount }} {{- i18n "article.word_count_unit" -}} + {{- i18n "article.word_count" .WordCount | emojify -}} {{- /* Trim EOF */ -}} \ No newline at end of file