i18n: update i18n string format (#371)

This commit is contained in:
Dillon
2020-05-18 16:10:24 +08:00
committed by GitHub
parent 36f59a72ee
commit 9c1244490f
35 changed files with 236 additions and 284 deletions

View File

@@ -1,13 +1,13 @@
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} - {{ .Site.Title -}}
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} - {{ .Site.Title -}}
</title>
<link>
{{- .Permalink -}}
</link>
<description>
{{- .Params.Title | default (T .Section) | default .Section | string | printf (T "allSome" | string) }} | {{ .Site.Title -}}
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} | {{ .Site.Title -}}
</description>
<generator>Hugo -- gohugo.io</generator>
{{- with .Site.LanguageCode -}}

View File

@@ -37,23 +37,21 @@
{{- partial "plugin/link.html" $options -}}
</span>
{{- with .Params.categories -}}
&nbsp;
<span class="post-category">
{{- T "included" -}}
{{- range $index, $value := . -}}
{{- if gt $index 0 }}&nbsp;{{ end -}}
{{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}}
<a href="{{ $category.RelPermalink }}">
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
</a>
{{- end -}}
{{- $categories := slice -}}
{{- range .Params.categories -}}
{{- $category := . | anchorize | printf "/categories/%v" | $.Site.GetPage -}}
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
{{- end -}}
{{- with delimit $categories "&nbsp;" -}}
&nbsp;<span class="post-category">
{{- dict "Categories" . | T "includedInCategories" | safeHTML -}}
</span>
{{- end -}}
</div>
<div class="post-meta-line">
{{- $publish_date := .PublishDate.Format (.Site.Params.dateformat | default "2006-01-02") -}}
<i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;
{{- with .Site.Params.dateformat | default "2006-01-02" | .PublishDate.Format -}}
<i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime="{{ . }}">{{ . }}</time>&nbsp;
{{- end -}}
<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;{{ T "wordCount" .WordCount }}&nbsp;
<i class="far fa-clock fa-fw"></i>&nbsp;{{ T "readingTime" .ReadingTime }}&nbsp;
{{- $comment := .Scratch.Get "comment" | default dict -}}