Skip to content

Commit

Permalink
Add zh_cn.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed Apr 7, 2024
1 parent d234836 commit 3e9606a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
31 changes: 29 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'vitepress'
import { en } from "./en"
import { zh_cn } from "./zh_cn"

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand Down Expand Up @@ -36,14 +37,40 @@ export default defineConfig({
],

search: {
provider: 'local'
provider: 'local',
options: {
locales: {
"zh-cn": {
translations: {
button: {
buttonText: '搜索文档',
buttonAriaLabel: '搜索文档'
},
modal: {
noResultsText: '无法找到相关结果',
resetButtonTitle: '清除查询条件',
footer: {
selectText: '选择',
navigateText: '切换'
}
}
}
}
}
}
}
},

locales: {
root: {
"root": {
label: "English",
link: "/",
...en
},
"zh-cn": {
label: "群星模组",
link: "/zh-cn/",
...zh_cn
}
}
})
6 changes: 1 addition & 5 deletions docs/.vitepress/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import { defineConfig } from 'vitepress'

export const en = defineConfig({
lang: "en-US",
title: "Commander",
description: "An extension of the data pack system.",

themeConfig: {
nav: [
{ text: 'Home', link: '/' }
],

sidebar: [
{
text: 'Examples',
items: [
{ text: 'Welcome!', link: '/' },
{ text: 'Events', link: '/Events' },
Expand Down
20 changes: 20 additions & 0 deletions docs/.vitepress/zh_cn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'vitepress'

export const zh_cn = defineConfig({
lang: "zh-CN",
title: "命令官",
description: "An extension of the data pack system.",

themeConfig: {
sidebar: [
{
items: [
{ text: 'Welcome!', link: '/zh-cn/' },
{ text: 'Events', link: '/zh-cn/Events' },
{ text: 'Commands', link: '/zh-cn/Commands' },
{ text: 'Arithmetica', link: '/zh-cn/Arithmetica' }
]
}
]
}
})

0 comments on commit 3e9606a

Please sign in to comment.