feat(i18n): add switchTheme i18n

This commit is contained in:
Dillon 2020-01-30 13:17:42 +08:00
parent 78ef3fa2f3
commit 7e6236361f
6 changed files with 30 additions and 19 deletions

View file

@ -24,10 +24,15 @@ other = "Categories"
# === Taxonomy ===
# === Pagination ===
[More]
[more]
other = "More"
# === Pagination ===
# === partials/header.html ===
[switchTheme]
other = "Switch Theme"
# === partials/header.html ===
# === partials/comments.html ===
[valineLang]
other = "en"
@ -75,7 +80,7 @@ other = "Back"
[home]
other = "Home"
[readmore]
[readMore]
other = "Read More"
[day]

View file

@ -24,10 +24,15 @@ other = "分类"
# === Taxonomy ===
# === Pagination ===
[More]
[more]
other = "更多"
# === Pagination ===
# === partials/header.html ===
[switchTheme]
other = "切换主题"
# === partials/header.html ===
# === partials/comments.html ===
[valineLang]
other = "zh-cn"
@ -78,7 +83,7 @@ other = "返回"
[home]
other = "主页"
[readmore]
[readMore]
other = "阅读全文"
[day]

View file

@ -47,7 +47,7 @@
{{ end }}
</div>
<div class="post-footer">
<a href="{{ .Permalink }}">{{ T "readmore" }}</a>
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
{{ with .Params.tags }}
<div class="post-tags">
{{ range . }}

View file

@ -22,13 +22,13 @@
<!-- gitalk Comment System-->
{{- if .Site.Params.gitalk.owner -}}
<div id="gitalk-container"></div>
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.gitalk_css }}
{{ if .Site.Params.cdn.gitalk_css }}
{{ .Site.Params.cdn.gitalk_css | safeHTML }}
{{ else }}
{{- $res := resources.Get "css/lib/gitalk/gitalk.css" | resources.Minify -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{ end }}
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.gitalk_js }}
{{ if .Site.Params.cdn.gitalk_js }}
{{ .Site.Params.cdn.gitalk_js | safeHTML }}
{{ else }}
{{- $res := resources.Get "js/lib/gitalk/gitalk.min.js" | resources.Minify -}}
@ -53,7 +53,7 @@
<!-- valine -->
{{- if .Site.Params.valine.enable -}}
<div id="vcomments"></div>
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.valine_js }}
{{ if .Site.Params.cdn.valine_js }}
{{ .Site.Params.cdn.valine_js | safeHTML }}
{{ else }}
{{- $res := resources.Get "js/lib/valine/Valine.min.js" | resources.Minify -}}
@ -79,16 +79,16 @@
<!-- facebook comment -->
{{- if .Site.Params.facebook.enable -}}
<div id="fb-root"></div>
<script
async
defer
crossorigin="anonymous"
<script
async
defer
crossorigin="anonymous"
src="https://connect.facebook.net/{{ .Site.Params.facebook.languageCode }}/sdk.js#xfbml=1&version=v5.0&appId={{ .Site.Params.facebook.appId }}&autoLogAppEvents=1"
></script>
<div
class="fb-comments"
<div
class="fb-comments"
data-href="{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}"
data-width="{{ .Site.Params.facebook.width }}"
data-width="{{ .Site.Params.facebook.width }}"
data-numposts="{{ .Site.Params.facebook.numPosts }}"
></div>
{{- end -}}

View file

@ -8,12 +8,13 @@
{{ range .Site.Menus.main }}
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) | or (eq $currentPage.RelPermalink .URL) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name | safeHTML }}</a>
{{ end }}
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="Switch Theme"></i></a>
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title={{ T "switchTheme" }}></i></a>
</div>
</div>
</nav>
<nav class="navbar-mobile">
<div class="navbar-container">
<div class="navbar-container">
<div class="navbar-header">
<div class="navbar-header-title animated bounceIn">
<a href="{{.Site.BaseURL}}">{{ .Site.Title }}</a>
@ -27,7 +28,7 @@
{{ range .Site.Menus.main }}
<a class="menu-item" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name | safeHTML }}</a>
{{ end }}
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw"></i></a>
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title={{ T "switchTheme" }}></i></a>
</div>
</div>
</nav>

View file

@ -29,7 +29,7 @@
{{ end }}
{{ if gt (len $pages) 5 }}
<span class="more-post">
<a href="{{ .Permalink }}" class="more-post-link">{{ T "More" }} >></a>
<a href="{{ .Permalink }}" class="more-post-link">{{ T "more" }} >></a>
</span>
{{ end }}
</div>