add multi language
This commit is contained in:
51
.vitepress/config/en.ts
Normal file
51
.vitepress/config/en.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import {defineConfig} from "vitepress";
|
||||
|
||||
export const en = defineConfig({
|
||||
lang: 'en-US',
|
||||
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'User guide', link: '/docs/en/user_guide/client_docs'},
|
||||
{text: 'Server guide', link: '/docs/en/dev_guide/introduction'}
|
||||
],
|
||||
|
||||
sidebar: {
|
||||
'/docs/en/user_guide/': [
|
||||
{
|
||||
text: 'Game user guide',
|
||||
items: [
|
||||
{
|
||||
text: 'Installation',
|
||||
items: [
|
||||
{text: 'IOS', link: '/docs/en/user_guide/installation/ios'},
|
||||
{text: 'Android', link: '/docs/en/user_guide/installation/android'},
|
||||
],
|
||||
},
|
||||
{text: '游戏内使用说明', link: '/docs/en/user_guide/client_docs'},
|
||||
{text: 'WebUI使用说明', link: '/docs/en/user_guide/user_webui'},
|
||||
{text: '游戏相关信息', link: '/docs/en/user_guide/game_info'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/docs/en/dev_guide/': [
|
||||
{
|
||||
text: '服务器指南',
|
||||
items: [
|
||||
{text: '介绍', link: '/docs/en/dev_guide/introduction'},
|
||||
{
|
||||
text: '安装',
|
||||
items: [
|
||||
{text: 'Windows', link: '/docs/en/dev_guide/installation/windows'},
|
||||
{text: 'Linux', link: '/docs/en/dev_guide/installation/linux'},
|
||||
{text: 'docker', link: '/docs/en/dev_guide/installation/docker'},
|
||||
],
|
||||
},
|
||||
{text: 'WebUI', link: '/docs/en/dev_guide/WebUI'},
|
||||
{text: '游戏资源服务器配置', link: '/docs/en/dev_guide/assets_docs'},
|
||||
{text: '环境变量和命令行参数', link: '/docs/en/dev_guide/variable-argument'},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
});
|
12
.vitepress/config/index.ts
Normal file
12
.vitepress/config/index.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import {defineConfig} from 'vitepress'
|
||||
import {en} from './en'
|
||||
import {zh} from './zh'
|
||||
import {shared} from "./shared";
|
||||
|
||||
export default defineConfig({
|
||||
...shared,
|
||||
locales: {
|
||||
root: {label: "简体中文", ...zh},
|
||||
en: {label: 'English', link: '/docs/en/', ...en}
|
||||
}
|
||||
})
|
22
.vitepress/config/shared.ts
Normal file
22
.vitepress/config/shared.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import {defineConfig} from 'vitepress'
|
||||
|
||||
export const shared = defineConfig({
|
||||
title: "Sif 2",
|
||||
description: "A Sif2 Server and Client Documents",
|
||||
ignoreDeadLinks: true,
|
||||
themeConfig: {
|
||||
logo: '/logo.png',
|
||||
socialLinks: [
|
||||
{icon: 'github', link: 'https://git.zhushenwudi.top/zhushenwudi/ew'}
|
||||
]
|
||||
},
|
||||
markdown: {
|
||||
image: {
|
||||
// 默认禁用;设置为 true 可为所有图片启用懒加载。
|
||||
lazyLoading: true
|
||||
}
|
||||
},
|
||||
rewrites: {
|
||||
'docs/zh/:rest*': ':rest*'
|
||||
}
|
||||
});
|
64
.vitepress/config/zh.ts
Normal file
64
.vitepress/config/zh.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import {defineConfig} from "vitepress";
|
||||
|
||||
export const zh = defineConfig({
|
||||
lang: 'zh-Hans',
|
||||
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '用户指南', link: '/docs/zh/user_guide/client_docs'},
|
||||
{text: '服务器指南', link: '/docs/zh/dev_guide/introduction'}
|
||||
],
|
||||
|
||||
sidebar: {
|
||||
'/docs/zh/user_guide/': [
|
||||
{
|
||||
text: '游戏用户指南',
|
||||
items: [
|
||||
{
|
||||
text: '安装',
|
||||
items: [
|
||||
{text: 'IOS', link: '/docs/zh/user_guide/installation/ios'},
|
||||
{text: 'Android', link: '/docs/zh/user_guide/installation/android'},
|
||||
],
|
||||
},
|
||||
{text: '游戏内使用说明', link: '/docs/zh/user_guide/client_docs'},
|
||||
{text: 'WebUI使用说明', link: '/docs/zh/user_guide/user_webui'},
|
||||
{text: '游戏相关信息', link: '/docs/zh/user_guide/game_info'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/docs/zh/dev_guide/': [
|
||||
{
|
||||
text: '服务器指南',
|
||||
items: [
|
||||
{text: '介绍', link: '/docs/zh/dev_guide/introduction'},
|
||||
{
|
||||
text: '安装',
|
||||
items: [
|
||||
{text: 'Windows', link: '/docs/zh/dev_guide/installation/windows'},
|
||||
{text: 'Linux', link: '/docs/zh/dev_guide/installation/linux'},
|
||||
{text: 'docker', link: '/docs/zh/dev_guide/installation/docker'},
|
||||
],
|
||||
},
|
||||
{text: 'WebUI', link: '/docs/zh/dev_guide/WebUI'},
|
||||
{text: '游戏资源服务器配置', link: '/docs/zh/dev_guide/assets_docs'},
|
||||
{text: '环境变量和命令行参数', link: '/docs/zh/dev_guide/variable-argument'},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
docFooter: {
|
||||
prev: '上一页',
|
||||
next: '下一页'
|
||||
},
|
||||
|
||||
langMenuLabel: '多语言',
|
||||
returnToTopLabel: '回到顶部',
|
||||
sidebarMenuLabel: '菜单',
|
||||
darkModeSwitchLabel: '主题',
|
||||
lightModeSwitchTitle: '切换到浅色模式',
|
||||
darkModeSwitchTitle: '切换到深色模式',
|
||||
skipToContentLabel: '跳转到内容'
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user