refactor: remove i18n labels and centralize in config

Delete multilingual i18n files for UI labels. Add English labels to
params.toml under [labels]. Update 404.html, single.html, and nav.html
to use site.Params.labels instead of i18n.

Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
Sped0n
2025-11-12 00:25:04 +08:00
committed by Ryan
parent c9410c9644
commit ba0def753e
17 changed files with 25 additions and 166 deletions

View File

@@ -18,7 +18,7 @@ hiResOpt = "2500x webp Lanczos q75"
# unified alt text for all images in the page
unifiedAlt = ''
# Site verification code for Google/Bing/Yandex/Pinterest/Baidu
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
[verification]
google = ""
bing = ""
@@ -28,7 +28,7 @@ baidu = ""
so = ""
sogou = ""
# Analytics config
# analytics config
[analytics]
enable = true
# Google Analytics
@@ -66,3 +66,12 @@ No_cookie = true
Do_not_track = true
# token(optional), more info on https://splitbee.io/docs/embed-the-script
data_token = ""
# labels
[labels]
next = "next"
prev = "prev"
close = "close"
threshold = "Threshold"
error = "page not found"
other = "loading..."

View File

@@ -1,12 +0,0 @@
[next]
other = "nächste"
[prev]
other = "vorher"
[close]
other = "schließen"
[threshold]
other = "schwelle"
[404]
other = "seite nicht gefunden"
[loading]
other = "lade..."

View File

@@ -1,12 +0,0 @@
[next]
other = "next"
[prev]
other = "prev"
[close]
other = "close"
[threshold]
other = "threshold"
[404]
other = "page not found"
[loading]
other = "loading..."

View File

@@ -1,12 +0,0 @@
[next]
other = "siguiente"
[prev]
other = "previo"
[close]
other = "cerrar"
[threshold]
other = "umbral"
[404]
other = "página no encontrada"
[loading]
other = "cargando..."

View File

@@ -1,12 +0,0 @@
[next]
other = "suivant"
[prev]
other = "précédent"
[close]
other = "fermer"
[threshold]
other = "seuil"
[404]
other = "page non trouvée"
[loading]
other = "chargement..."

View File

@@ -1,12 +0,0 @@
[next]
other = "prossimo"
[prev]
other = "precedente"
[close]
other = "chiudi"
[threshold]
other = "soglia"
[404]
other = "pagina non trovata"
[loading]
other = "caricamento..."

View File

@@ -1,12 +0,0 @@
[next]
other = "進む"
[prev]
other = "後退"
[close]
other = "閉じる"
[threshold]
other = "しきい値"
[404]
other = "ページが見つかりません"
[loading]
other = "読み込み中..."

View File

@@ -1,12 +0,0 @@
[next]
other = "전진"
[prev]
other = "물러나세요"
[close]
other = "닫기"
[threshold]
other = "임계값"
[404]
other = "페이지를 찾을 수 없습니다"
[loading]
other = "로딩중..."

View File

@@ -1,12 +0,0 @@
[next]
other = "அடுத்தது"
[prev]
other = "முந்தையது"
[close]
other = "வெளியே செல்ல"
[threshold]
other = "எல்லை"
[404]
other = "பக்கம் காணப்படவில்லை"
[loading]
other = "பதிவேற்றம் நடக்கிறது..."

View File

@@ -1,12 +0,0 @@
[next]
other = "前进"
[prev]
other = "后退"
[close]
other = "关闭"
[threshold]
other = "阈值"
[404]
other = "页面不存在"
[loading]
other = "加载中..."

View File

@@ -1,12 +0,0 @@
[next]
other = "前進"
[prev]
other = "後退"
[close]
other = "關閉"
[threshold]
other = "閾值"
[404]
other = "找不到頁面"
[loading]
other = "載入中..."

View File

@@ -1,12 +0,0 @@
[next]
other = "前進"
[prev]
other = "後退"
[close]
other = "關閉"
[threshold]
other = "閾值"
[404]
other = "找不到頁面"
[loading]
other = "載入中..."

View File

@@ -1,12 +0,0 @@
[next]
other = "前进"
[prev]
other = "后退"
[close]
other = "关闭"
[threshold]
other = "阈值"
[404]
other = "页面不存在"
[loading]
other = "加载中..."

View File

@@ -1,12 +0,0 @@
[next]
other = "前進"
[prev]
other = "後退"
[close]
other = "關閉"
[threshold]
other = "閾值"
[404]
other = "找不到頁面"
[loading]
other = "載入中..."

View File

@@ -2,9 +2,15 @@
<div class="container">
{{- partial "nav.html" . -}}
<article>
<p class="error">&#9949; <u>404</u>&nbsp;{{- i18n 404 -}}&nbsp;&#9949;</p>
<p class="error">&#9949; <u>404</u>&nbsp;{{- i18n 404 -}}&nbsp;&#9949;</p>
<p class="error">&#9949; <u>404</u>&nbsp;{{- i18n 404 -}}&nbsp;&#9949;</p>
<p class="error">
&#9949; <u>404</u>&nbsp;{{- site.Params.labels.error -}}&nbsp;&#9949;
</p>
<p class="error">
&#9949; <u>404</u>&nbsp;{{- site.Params.labels.error -}}&nbsp;&#9949;
</p>
<p class="error">
&#9949; <u>404</u>&nbsp;{{- site.Params.labels.error -}}&nbsp;&#9949;
</p>
</article>
</div>
{{- end -}}

View File

@@ -1,10 +1,10 @@
{{- define "main" -}}
<div
class="container"
data-next="{{- i18n "next" -}}"
data-prev="{{- i18n "prev" -}}"
data-close="{{- i18n "close" -}}"
data-loading="{{- i18n "loading" -}}"
data-next="{{- site.Params.labels.next -}}"
data-prev="{{- site.Params.labels.prev -}}"
data-close="{{- site.Params.labels.close -}}"
data-loading="{{- site.Params.labels.loading -}}"
>
{{- with .Content -}}
<article>

View File

@@ -37,7 +37,7 @@
{{- with partial "function/getImageSlice.html" . -}}
{{- $length = len . -}}
{{- end -}}
<span>{{- i18n "threshold" | strings.FirstUpper -}}:</span>
<span>{{- site.Params.labels.threshold -}}:</span>
<span>
<button class="dec">&#xFF0D;</button>
<span class="num"></span><span class="num"></span><span class="num"></span