Enable multilingual support

This commit is contained in:
CDN 2025-04-20 15:29:54 +08:00
parent ed7245c6be
commit 4af1379d1e
Signed by: CDN
GPG key ID: 0C656827F9F80080
2 changed files with 24 additions and 5 deletions

View file

@ -10,19 +10,33 @@ enableRobotsTXT = true
# contains `<link rel="alternate" type="application/rss&#43;xml" href="/v1.4/v1.4/index.xml">`). # contains `<link rel="alternate" type="application/rss&#43;xml" href="/v1.4/v1.4/index.xml">`).
disableKinds = ["taxonomy", "RSS"] disableKinds = ["taxonomy", "RSS"]
defaultContentLanguage = "zh-Hans"
[languages] [languages]
[languages.zh-Hans]
title = "Matrix 规范"
languageName = "简体中文"
weight = 1
contentDir = "locales/zh-Hans"
[languages.zh-Hans.params]
description = "Matrix 去中心化通信规范的首页"
[languages.en] [languages.en]
title = "Matrix Specification" title = "Matrix Specification"
languageName ="English" languageName ="English"
# Weight used for sorting. # Weight used for sorting.
weight = 1 weight = 2
contentDir = "content/"
[languages.en.params] [languages.en.params]
description = "Home of the Matrix specification for decentralised communication" description = "Home of the Matrix specification for decentralised communication"
# Entries in the main menu in the header. # Entries in the main menu in the header.
[menus] [menus]
[[menus.main]] [[menus.main]]
name = 'Foundation' name = '翻译'
url = 'https://codeberg.org/wholetrans/docs-matrix-spec'
weight = 5
[[menus.main]]
name = '基金会'
url = 'https://matrix.org/foundation/' url = 'https://matrix.org/foundation/'
weight = 10 weight = 10
[[menus.main]] [[menus.main]]
@ -30,7 +44,7 @@ description = "Home of the Matrix specification for decentralised communication"
url = 'https://matrix.org/faq' url = 'https://matrix.org/faq'
weight = 20 weight = 20
[[menus.main]] [[menus.main]]
name = 'Blog' name = '博客'
url = 'https://matrix.org/blog/posts' url = 'https://matrix.org/blog/posts'
weight = 30 weight = 30
@ -56,7 +70,7 @@ description = "Home of the Matrix specification for decentralised communication"
# Everything below this are Site Params # Everything below this are Site Params
[params] [params]
copyright = "The Matrix.org Foundation CIC" copyright = "The Matrix.org Foundation CIC. Translation maintained by WholeTrans."
[params.version] [params.version]
# must be one of "unstable", "current", "historical" # must be one of "unstable", "current", "historical"
@ -92,6 +106,11 @@ sidebar_menu_compact = true
# icon = "fab fa-github" # icon = "fab fa-github"
# desc = "Matrix on GitHub" # desc = "Matrix on GitHub"
# Custom links shown in the center of the footer. (Only supported by our fork of docsy's 'footer/central' partial.) # Custom links shown in the center of the footer. (Only supported by our fork of docsy's 'footer/central' partial.)
[[params.links.bottom]]
name = "Localization Repo"
url = "https://codeberg.org/wholetrans/docs-matrix-spec"
icon = "far fa-language"
desc = "Localization Repository"
[[params.links.bottom]] [[params.links.bottom]]
name = "GitHub" name = "GitHub"
url = "https://github.com/matrix-org" url = "https://github.com/matrix-org"

View file

@ -26,7 +26,7 @@
</span> </span>
{{- /**/ -}} {{- /**/ -}}
<span class="navbar-brand__name"> <span class="navbar-brand__name">
specification 规范
</span> </span>
{{- /**/ -}} {{- /**/ -}}
<span class="navbar-version"> &mdash; {{ partial "version-string" . }}</span> <span class="navbar-version"> &mdash; {{ partial "version-string" . }}</span>