diff --git a/themes/bonsai/i18n/en.toml b/themes/bonsai/i18n/en.toml new file mode 100644 index 0000000..95f7fb2 --- /dev/null +++ b/themes/bonsai/i18n/en.toml @@ -0,0 +1,14 @@ +# Bonsai theme — English strings. +# Override per language by adding e.g. i18n/vi.toml; missing keys fall back to en. + +[nav_links_label] +other = "Links" + +[theme_toggle_label] +other = "Toggle light and dark theme" + +[theme_toggle_title] +other = "Toggle theme" + +[footer_default] +other = "© {{ .year }} {{ .name }}" diff --git a/themes/bonsai/i18n/vi.toml b/themes/bonsai/i18n/vi.toml new file mode 100644 index 0000000..a0f854b --- /dev/null +++ b/themes/bonsai/i18n/vi.toml @@ -0,0 +1,13 @@ +# Bonsai theme — Vietnamese strings. + +[nav_links_label] +other = "Liên kết" + +[theme_toggle_label] +other = "Chuyển giao diện sáng / tối" + +[theme_toggle_title] +other = "Đổi giao diện" + +[footer_default] +other = "© {{ .year }} {{ .name }}" diff --git a/themes/bonsai/layouts/partials/footer.html b/themes/bonsai/layouts/partials/footer.html index 010630b..d46f292 100644 --- a/themes/bonsai/layouts/partials/footer.html +++ b/themes/bonsai/layouts/partials/footer.html @@ -3,7 +3,8 @@ {{- with site.Params.footerText -}}
{{ . | safeHTML }}
{{- else -}} -© {{ now.Year }} {{ site.Params.name | default site.Title }}
+ {{- $ctx := dict "year" now.Year "name" (site.Params.name | default site.Title) -}} +{{ i18n "footer_default" $ctx | default (printf "© %d %s" now.Year (site.Params.name | default site.Title)) | safeHTML }}
{{- end -}} {{- if site.Params.themeToggle -}} {{ partial "theme-toggle-button.html" . }} diff --git a/themes/bonsai/layouts/partials/theme-toggle-button.html b/themes/bonsai/layouts/partials/theme-toggle-button.html index 02041c2..8b81d65 100644 --- a/themes/bonsai/layouts/partials/theme-toggle-button.html +++ b/themes/bonsai/layouts/partials/theme-toggle-button.html @@ -2,9 +2,9 @@ Sun shown in dark mode (target = light). Moon shown in light mode (target = dark). */ -}}