Add i18n chinese translation

pull/2/head
canstand 2021-09-20 11:24:28 +08:00
parent 4eb4ae4493
commit 962a4875ee
4 changed files with 43 additions and 18 deletions

View File

@ -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"

33
i18n/zh.yaml 100644
View File

@ -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: "未找到图标。"

View File

@ -23,7 +23,7 @@
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<div class="ml-2">
{{ partial "badge.html" "Draft" }}
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</div>
{{ end }}
{{ if templates.Exists "partials/extend-article-link.html" }}

View File

@ -12,22 +12,14 @@
{{/* Theme attribution */}}
{{ if .Site.Params.attribution | default true }}
<p class="text-xs text-neutral-300 dark:text-neutral-600">
{{ i18n "footer.powered_by" }}
<a
class="hover:underline hover:underline-primary-300 hover:text-primary-400"
href="https://gohugo.io/"
target="_blank"
rel="noopener noreferrer"
>Hugo</a
>
&amp;
<a
class="hover:underline hover:underline-primary-300 hover:text-primary-400"
href="https://git.io/hugo-congo"
target="_blank"
rel="noopener noreferrer"
>Congo</a
>
{{ $hugo := printf `<a class="hover:underline hover:underline-primary-300 hover:text-primary-400"
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>
&amp;
<a class="hover:underline hover:underline-primary-300 hover:text-primary-400" href="https://git.io/hugo-congo"
target="_blank" rel="noopener noreferrer">Congo</a>`
}}
{{ i18n "footer.powered_by" (dict "Hugo" $hugo) | safeHTML }}
</p>
{{ end }}
{{/* Extend footer - eg. for extra scripts, etc. */}}