🌐 Add better i18n support for article metadata

pull/100/head
James Panther 2022-01-24 13:58:19 +11:00
parent 61d80cf13d
commit b59137e458
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
13 changed files with 22 additions and 14 deletions

View File

@ -22,7 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed ### Changed
- ⚠️ Required Hugo version is now 0.87.0 or later - ⚠️ Required Hugo version is now 0.87.0 or later
- ⚠️ Author images are now Hugo assets - ⚠️ Author and logo images are now Hugo assets
- ⚠️ Overhauled `figure` shortcode which now resizes images - ⚠️ Overhauled `figure` shortcode which now resizes images
- ⚠️ Renamed parameter: `darkToggle` -> `showDarkToggle` - ⚠️ Renamed parameter: `darkToggle` -> `showDarkToggle`
- Upgrade to Tailwind v3.0.15 - Upgrade to Tailwind v3.0.15

View File

@ -1,5 +1,7 @@
article: article:
anchor_label: "Anker" anchor_label: "Anker"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
draft: "Entwurf" draft: "Entwurf"
edit_title: "Inhalt bearbeiten" edit_title: "Inhalt bearbeiten"
reading_time: reading_time:
@ -7,7 +9,6 @@ article:
other: "{{ .Count }} min" other: "{{ .Count }} min"
reading_time_title: "Lesezeit" reading_time_title: "Lesezeit"
# table_of_contents: "Table of Contents" # table_of_contents: "Table of Contents"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -1,5 +1,7 @@
article: article:
anchor_label: "Anchor" anchor_label: "Anchor"
date: "{{ .Date }}"
date_updated: "Updated: {{ .Date }}"
draft: "Draft" draft: "Draft"
edit_title: "Edit content" edit_title: "Edit content"
reading_time: reading_time:
@ -7,7 +9,6 @@ article:
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Reading time" reading_time_title: "Reading time"
table_of_contents: "Table of Contents" table_of_contents: "Table of Contents"
updated: "Updated"
word_count: word_count:
one: "{{ .Count }} word" one: "{{ .Count }} word"
other: "{{ .Count }} words" other: "{{ .Count }} words"

View File

@ -1,5 +1,7 @@
article: article:
anchor_label: "Ancla" anchor_label: "Ancla"
date: "{{ .Date }}"
date_updated: "Actualizado: {{ .Date }}"
draft: "Borrador" draft: "Borrador"
edit_title: "Editar contenido" edit_title: "Editar contenido"
reading_time: reading_time:
@ -7,7 +9,6 @@ article:
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Tiempo de lectura" reading_time_title: "Tiempo de lectura"
# table_of_contents: "Table of Contents" # table_of_contents: "Table of Contents"
updated: "Actualizado"
word_count: word_count:
one: "{{ .Count }} palabra" one: "{{ .Count }} palabra"
other: "{{ .Count }} palabras" other: "{{ .Count }} palabras"

View File

@ -1,5 +1,7 @@
article: article:
anchor_label: "Ancre" anchor_label: "Ancre"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
draft: "Brouillon" draft: "Brouillon"
edit_title: "Editer" edit_title: "Editer"
reading_time: reading_time:
@ -7,7 +9,6 @@ article:
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Temps de lecture" reading_time_title: "Temps de lecture"
# table_of_contents: "Table of Contents" # table_of_contents: "Table of Contents"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -1,5 +1,7 @@
article: article:
anchor_label: "Anchor" anchor_label: "Anchor"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
draft: "Draft" draft: "Draft"
edit_title: "Editar Conteúdo" edit_title: "Editar Conteúdo"
reading_time: reading_time:
@ -7,7 +9,6 @@ article:
other: "{{ .Count }} minutos" other: "{{ .Count }} minutos"
reading_time_title: "Tempo de leitura" reading_time_title: "Tempo de leitura"
# table_of_contents: "Table of Contents" # table_of_contents: "Table of Contents"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -1,12 +1,13 @@
article: article:
anchor_label: "Anchor" anchor_label: "Anchor"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
draft: "Taslak" draft: "Taslak"
edit_title: "İçeriği düzenle" edit_title: "İçeriği düzenle"
reading_time: reading_time:
one: "{{ .Count }} dk" one: "{{ .Count }} dk"
other: "{{ .Count }} dk" other: "{{ .Count }} dk"
reading_time_title: "Okuma süresi" reading_time_title: "Okuma süresi"
# updated: "Updated"
word_count: word_count:
one: "{{ .Count }} kelime" one: "{{ .Count }} kelime"
other: "{{ .Count }} kelime" other: "{{ .Count }} kelime"

View File

@ -1,12 +1,13 @@
article: article:
anchor_label: "锚点" anchor_label: "锚点"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
draft: "草稿" draft: "草稿"
edit_title: "编辑内容" edit_title: "编辑内容"
reading_time: reading_time:
other: "{{ .Count }} 分钟" other: "{{ .Count }} 分钟"
reading_time_title: "预计阅读" reading_time_title: "预计阅读"
# table_of_contents: "Table of Contents" # table_of_contents: "Table of Contents"
# updated: "Updated"
word_count: word_count:
one: "{{ .Count }} 字" one: "{{ .Count }} 字"
other: "{{ .Count }} 字" other: "{{ .Count }} 字"

View File

@ -0,0 +1 @@
{{ return time.Format (site.Language.Params.dateFormat | default ":date_long") . }}

View File

@ -1,3 +1,4 @@
{{- i18n "article.updated" -}}:&nbsp; <time datetime="{{ . }}">
{{ partial "meta/date.html" . }} {{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
</time>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@ -1,4 +1,4 @@
<time datetime="{{ . }}"> <time datetime="{{ . }}">
{{- . | time.Format (site.Language.Params.dateFormat | default ":date_long") -}} {{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
</time> </time>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@ -1,4 +1,4 @@
<span title="{{ i18n "article.reading_time_title" }}"> <span title="{{ i18n "article.reading_time_title" }}">
{{- i18n "article.reading_time" .ReadingTime | emojify -}} {{- i18n "article.reading_time" .ReadingTime | markdownify | emojify -}}
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@ -1,5 +1,4 @@
<span> <span>
{{- i18n "article.word_count" .WordCount | emojify -}} {{- i18n "article.word_count" .WordCount | markdownify | emojify -}}
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}