refactor: migrate i18n files from YAML to TOML format and simplify structure (#1230)

* refactor: migrate i18n files from YAML to TOML format and simplify structure

* refactor: make translation file adjust to gohugoio/locales language code so date translation can work properly

* refactor: use hyphens instead of underscores for i18n, because that's how Hugo pick the translation file

* docs: update comments for i18n language availability and CJK language detection in hugo.toml.
This commit is contained in:
Jimmy
2026-01-25 21:01:32 +01:00
committed by GitHub
parent 406fcef7cd
commit c872a77edb
73 changed files with 1495 additions and 2303 deletions
+3 -4
View File
@@ -4,17 +4,16 @@ title = "Example Site"
copyright = "Example Person"
# Theme i18n support
# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
# See i18n folder for available languages
defaultContentLanguage = "en"
# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
# This will make .Summary and .WordCount behave correctly for CJK languages.
# Set hasCJKLanguage to true if DefaultContentLanguage is a CJK language
# This will make .Summary and .WordCount behave correctly
hasCJKLanguage = false
[[module.imports]]
path = "github.com/CaiJimmy/hugo-theme-stack/v3"
[pagination]
pagerSize = 3
+4 -4
View File
@@ -5,18 +5,18 @@
[en.params.sidebar]
subtitle = "Example description"
[zh-cn]
[zh]
languageName = "简体中文"
title = "演示站点"
weight = 2
[zh-cn.params.sidebar]
[zh.params.sidebar]
subtitle = "演示说明"
[zh-tw]
[zh-hant-tw]
languageName = "正體中文"
title = "演示站點"
weight = 2
[zh-tw.params.sidebar]
[zh-hant-tw.params.sidebar]
subtitle = "演示說明"
[ja]
-4
View File
@@ -5,10 +5,6 @@ favicon = ""
[footer]
since = 2020
[dateFormat]
published = "Jan 02, 2006"
lastUpdated = "Jan 02, 2006 15:04 MST"
[sidebar]
emoji = "🍥"
subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."