From 3e9606ad7bc43fbc2c1cdff963db7e8bab316768 Mon Sep 17 00:00:00 2001 From: melontini <104443436+melontini@users.noreply.github.com> Date: Sun, 7 Apr 2024 21:04:45 +0700 Subject: [PATCH] Add zh_cn.ts --- docs/.vitepress/config.mts | 31 +++++++++++++++++++++++++++++-- docs/.vitepress/en.ts | 6 +----- docs/.vitepress/zh_cn.ts | 20 ++++++++++++++++++++ 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 docs/.vitepress/zh_cn.ts diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index d67c602..3610980 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -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({ @@ -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 } } }) diff --git a/docs/.vitepress/en.ts b/docs/.vitepress/en.ts index 8a51e36..790bcb8 100644 --- a/docs/.vitepress/en.ts +++ b/docs/.vitepress/en.ts @@ -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' }, diff --git a/docs/.vitepress/zh_cn.ts b/docs/.vitepress/zh_cn.ts new file mode 100644 index 0000000..5f18c2c --- /dev/null +++ b/docs/.vitepress/zh_cn.ts @@ -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' } + ] + } + ] + } +}) \ No newline at end of file