From 962a4875ee5b888e1352975c3c1ee5bfe712fe91 Mon Sep 17 00:00:00 2001 From: canstand Date: Mon, 20 Sep 2021 11:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Add=20i18n=20chinese=20translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/en.yaml | 2 +- i18n/zh.yaml | 33 ++++++++++++++++++++++++++++++ layouts/partials/article-link.html | 2 +- layouts/partials/footer.html | 24 ++++++++-------------- 4 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 i18n/zh.yaml diff --git a/i18n/en.yaml b/i18n/en.yaml index ffda4d4a..6052261f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -16,7 +16,7 @@ error: 404_description: "It seems that the page you've requested does not exist." footer: - powered_by: "Powered by" + powered_by: "Powered by {{ .Hugo }}" list: externalurl_title: "Link to external site" diff --git a/i18n/zh.yaml b/i18n/zh.yaml new file mode 100644 index 00000000..4d48f9b5 --- /dev/null +++ b/i18n/zh.yaml @@ -0,0 +1,33 @@ +article: + anchor_label: "锚点" + draft: "草稿" + edit_title: "编辑内容" + reading_time: + other: "{{ .Count }} 分钟" + reading_time_title: "预计阅读" + +author: + byline_title: "作者" + +error: + 404_title: "找不到网页 :confused:" + 404_error: "404 错误" + 404_description: "您请求的页面似乎不存在。" + +footer: + powered_by: "由 {{ .Hugo }} 强力驱动" + +list: + externalurl_title: "链接到外部网站" + no_articles: "这里还没有任何文章可以列出。" + +sharing: + email: "通过电子邮件发送" + facebook: "分享到 Facebook" + linkedin: "分享到 LinkedIn" + reddit: "提交到 Reddit" + twitter: "分享到 Twitter" + +shortcode: + recent_articles: "最近的文章" + icon_none: "未找到图标。" diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index dd752aee..0b576b14 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -23,7 +23,7 @@ {{ end }} {{ if and .Draft .Site.Params.article.showDraftLabel }}
- {{ partial "badge.html" "Draft" }} + {{ partial "badge.html" (i18n "article.draft" | emojify) }}
{{ end }} {{ if templates.Exists "partials/extend-article-link.html" }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 51559f75..278dfbd2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -12,22 +12,14 @@ {{/* Theme attribution */}} {{ if .Site.Params.attribution | default true }}

- {{ i18n "footer.powered_by" }} - Hugo - & - Congo + {{ $hugo := printf `Hugo + & + Congo` + }} + + {{ i18n "footer.powered_by" (dict "Hugo" $hugo) | safeHTML }}

{{ end }} {{/* Extend footer - eg. for extra scripts, etc. */}}