From c1b0eafce668c0c7498a5875c23c074eeb71e842 Mon Sep 17 00:00:00 2001 From: chaosarium <38693485+chaosarium@users.noreply.github.com> Date: Thu, 22 Dec 2022 13:34:21 -0500 Subject: [PATCH] feat: Added simplified Chinese translations (#257) --- i18n/zh-cn.toml | 65 ++++++++++++++++++++++++++++ layouts/partials/textprocessing.html | 19 +++++++- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 i18n/zh-cn.toml diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml new file mode 100644 index 00000000..ca8c1b1e --- /dev/null +++ b/i18n/zh-cn.toml @@ -0,0 +1,65 @@ +[404_message] +other = "喔哦...... 你是不是迷路了呀..... (⌯' '⌯ ) 这个页面并不存在(也许它还未被发布)。" + +[404_back] +other = "↳ 回到主页" + +[all_posts] +other = "所有 {{.Title}}" + +[last_updated] +other = "最后更新于" + +[notes_count] +other = "带有此标签的笔记" + +[first_10] +other = "正在展示前10个结果" + +[tag] +other = "标签" + +[backlinks] +other = "反向链接" + +[no_backlinks] +other = "没有找到反向链接" + +[home] +other = "主页" + +[light_mode] +other = "明亮模式" + +[dark_mode] +other = "黑暗模式" + +[edit_source] +other = "编辑源码" + +[interactive_graph] +other = "互动图" + +[search] +other = "搜索" + +[search_icon] +other = "搜索图标" + +[icon_search] +other = "打开搜索图标" + +[recent_notes] +other = "近期笔记" + +[first_3_notes] +other = "前3个 {{ .notes }}" + +[search_for_something] +other = "进行搜索......" + +[toc] +other = "目录" + +[copyright] +other = "由 {{ .name }} 用 Quartz 创造, © {{ .year }}" diff --git a/layouts/partials/textprocessing.html b/layouts/partials/textprocessing.html index 7b82f322..dbcc0535 100644 --- a/layouts/partials/textprocessing.html +++ b/layouts/partials/textprocessing.html @@ -42,7 +42,24 @@ {{$display := index (last 1 (split $display "/")) 0}} - {{$curpage := $page.GetPage $title}} + + {{$searchtitle := $title }} + {{$curpage := $page.GetPage $searchtitle }} + + {{ if (eq $curpage.String "nopPage") }} + {{$searchtitle = (add $title ".md") }} + {{$curpage = $page.GetPage $searchtitle }} + {{ end }} + + {{ if (eq $curpage.String "nopPage") }} + {{$searchtitle = (replace $searchtitle "&" "&") }} + {{$searchtitle = (replace $searchtitle """ "\"") }} + {{$searchtitle = (replace $searchtitle "”" "\"") }} + {{$searchtitle = (replace $searchtitle "“" "\"") }} + {{$searchtitle = (replace $searchtitle "’" "'") }} + {{$searchtitle = (replace $searchtitle "‘" "'") }} + {{$curpage = $page.GetPage $searchtitle }} + {{ end }} {{$relpath := relURL $path}}