mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Migrate documents
This commit is contained in:
parent
de3e21dd64
commit
e5529eead9
31 changed files with 14988 additions and 1 deletions
74
docs/.vuepress/configs/gen_configs.py
Normal file
74
docs/.vuepress/configs/gen_configs.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import os
|
||||
|
||||
print('Read ../translations/*.json')
|
||||
LanguageCodeList = [ code.replace('.json', '') for code in os.listdir('../translations/') ]
|
||||
|
||||
print('Read ./l10n_configs/config_templete.ts')
|
||||
templete = ""
|
||||
with open('./l10n_configs/config_templete.ts', 'r', encoding='utf-8') as file:
|
||||
templete = file.read()
|
||||
|
||||
for LanguageCode in LanguageCodeList:
|
||||
content = templete
|
||||
|
||||
content = content.replace("$LanguageCode$", LanguageCode, -1)
|
||||
|
||||
content = content.replace("$LanguageCodeEscaped$", LanguageCode.replace('-', '_', -1), -1)
|
||||
|
||||
if (LanguageCode == 'en'):
|
||||
content = content.replace("$PathToPage$", '', -1)
|
||||
else:
|
||||
content = content.replace("$PathToPage$", '/' + LanguageCode, -1)
|
||||
|
||||
print("Write ./l10n_configs/{}.ts".format(LanguageCode))
|
||||
|
||||
with open('./l10n_configs/{}.ts'.format(LanguageCode), 'w+', encoding='utf-8') as file:
|
||||
file.write('/* This file is automatically generated by "gen_configs.py" */\n')
|
||||
file.write(content)
|
||||
|
||||
print("Write ./locales_config.ts")
|
||||
|
||||
with open('./locales_config.ts', 'w+', encoding='utf-8') as file:
|
||||
file.write('/* This file is automatically generated by "gen_configs.py" */\n')
|
||||
file.write(r"import type { SiteLocaleConfig } from '@vuepress/shared'" + '\n')
|
||||
file.write(r"import type { LocaleConfig } from '@vuepress/shared'" + '\n')
|
||||
|
||||
file.write('\n')
|
||||
|
||||
for LanguageCode in LanguageCodeList:
|
||||
LanguageCodeEscaped = LanguageCode.replace('-', '_', -1)
|
||||
file.write(r"import { mainConfig_")
|
||||
file.write(LanguageCodeEscaped)
|
||||
file.write(r", defaultThemeConfig_")
|
||||
file.write(LanguageCodeEscaped)
|
||||
file.write(r" } from './l10n_configs/")
|
||||
file.write(LanguageCode)
|
||||
file.write(".js'\n")
|
||||
|
||||
file.write('\n')
|
||||
|
||||
file.write(r"export const mainConfig: SiteLocaleConfig = {" + '\n')
|
||||
for LanguageCode in LanguageCodeList:
|
||||
file.write(r" '")
|
||||
if (LanguageCode != 'en'):
|
||||
file.write(r"/")
|
||||
file.write(LanguageCode)
|
||||
file.write(r"/': mainConfig_")
|
||||
file.write(LanguageCode.replace('-', '_', -1))
|
||||
file.write(",\n")
|
||||
file.write(r"}" + '\n')
|
||||
|
||||
file.write('\n')
|
||||
|
||||
file.write(r"export const defaultThemeConfig: LocaleConfig = {" + '\n')
|
||||
for LanguageCode in LanguageCodeList:
|
||||
file.write(r" '")
|
||||
if (LanguageCode != 'en'):
|
||||
file.write(r"/")
|
||||
file.write(LanguageCode)
|
||||
file.write(r"/': defaultThemeConfig_")
|
||||
file.write(LanguageCode.replace('-', '_', -1))
|
||||
file.write(",\n")
|
||||
file.write(r"}" + '\n')
|
||||
|
||||
print("** Done! **")
|
||||
8
docs/.vuepress/configs/head.ts
Normal file
8
docs/.vuepress/configs/head.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import type { HeadConfig } from '@vuepress/core'
|
||||
|
||||
export const head: HeadConfig[] = [
|
||||
["meta", { name: "theme-color", content: "#3eaf7c" }],
|
||||
["meta", { name: "apple-mobile-web-app-capable", content: "yes" }],
|
||||
["meta", { name: "apple-mobile-web-app-status-bar-style", content: "black" }],
|
||||
["link", { rel: "icon", href: "../../favicon.ico" }],
|
||||
]
|
||||
74
docs/.vuepress/configs/l10n_configs/config_templete.ts
Normal file
74
docs/.vuepress/configs/l10n_configs/config_templete.ts
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/$LanguageCode$.json')
|
||||
|
||||
export const mainConfig_$LanguageCodeEscaped$: SiteLocaleData = {
|
||||
lang: '$LanguageCode$',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_$LanguageCodeEscaped$: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "$PathToPage$/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "$PathToPage$/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "$PathToPage$/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "$PathToPage$/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "$PathToPage$/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"$PathToPage$/guide/README.md",
|
||||
"$PathToPage$/guide/installation.md",
|
||||
"$PathToPage$/guide/usage.md",
|
||||
"$PathToPage$/guide/configuration.md",
|
||||
"$PathToPage$/guide/chat-bots.md",
|
||||
"$PathToPage$/guide/creating-bots.md",
|
||||
"$PathToPage$/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
75
docs/.vuepress/configs/l10n_configs/en.ts
Normal file
75
docs/.vuepress/configs/l10n_configs/en.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/en.json')
|
||||
|
||||
export const mainConfig_en: SiteLocaleData = {
|
||||
lang: 'en',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_en: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"/guide/README.md",
|
||||
"/guide/installation.md",
|
||||
"/guide/usage.md",
|
||||
"/guide/configuration.md",
|
||||
"/guide/chat-bots.md",
|
||||
"/guide/creating-bots.md",
|
||||
"/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
75
docs/.vuepress/configs/l10n_configs/zh-Hans.ts
Normal file
75
docs/.vuepress/configs/l10n_configs/zh-Hans.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleData } from '@vuepress/shared'
|
||||
import type { DefaultThemeLocaleData } from '@vuepress/theme-default'
|
||||
import { head } from '../head.js'
|
||||
|
||||
const Translation = require('../../translations/zh-Hans.json')
|
||||
|
||||
export const mainConfig_zh_Hans: SiteLocaleData = {
|
||||
lang: 'zh-Hans',
|
||||
title: Translation.title,
|
||||
description: Translation.description,
|
||||
head: head
|
||||
}
|
||||
|
||||
export const defaultThemeConfig_zh_Hans: DefaultThemeLocaleData = {
|
||||
selectLanguageName: Translation.theme.selectLanguageName,
|
||||
selectLanguageText: Translation.theme.selectLanguageText,
|
||||
selectLanguageAriaLabel: Translation.theme.selectLanguageAriaLabel,
|
||||
|
||||
navbar: [
|
||||
{
|
||||
text: Translation.navbar.AboutAndFeatures,
|
||||
link: "/zh-Hans/guide/",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Installation,
|
||||
link: "/zh-Hans/guide/installation.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Usage,
|
||||
link: "/zh-Hans/guide/usage.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.Configuration,
|
||||
link: "/zh-Hans/guide/configuration.md",
|
||||
},
|
||||
|
||||
{
|
||||
text: Translation.navbar.ChatBots,
|
||||
link: "/zh-Hans/guide/chat-bots.md",
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
"/zh-Hans/guide/README.md",
|
||||
"/zh-Hans/guide/installation.md",
|
||||
"/zh-Hans/guide/usage.md",
|
||||
"/zh-Hans/guide/configuration.md",
|
||||
"/zh-Hans/guide/chat-bots.md",
|
||||
"/zh-Hans/guide/creating-bots.md",
|
||||
"/zh-Hans/guide/contibuting.md"
|
||||
],
|
||||
|
||||
// page meta
|
||||
editLinkText: Translation.theme.editLinkText,
|
||||
lastUpdatedText: Translation.theme.lastUpdatedText,
|
||||
contributorsText: Translation.theme.contributorsText,
|
||||
|
||||
// custom containers
|
||||
tip: Translation.theme.tip,
|
||||
warning: Translation.theme.warning,
|
||||
danger: Translation.theme.danger,
|
||||
|
||||
// 404 page
|
||||
notFound: Translation.theme.notFound,
|
||||
backToHome: Translation.theme.backToHome,
|
||||
|
||||
// a11y
|
||||
openInNewWindow: Translation.theme.openInNewWindow,
|
||||
toggleColorMode: Translation.theme.toggleColorMode,
|
||||
toggleSidebar: Translation.theme.toggleSidebar,
|
||||
}
|
||||
16
docs/.vuepress/configs/locales_config.ts
Normal file
16
docs/.vuepress/configs/locales_config.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* This file is automatically generated by "gen_configs.py" */
|
||||
import type { SiteLocaleConfig } from '@vuepress/shared'
|
||||
import type { LocaleConfig } from '@vuepress/shared'
|
||||
|
||||
import { mainConfig_en, defaultThemeConfig_en } from './l10n_configs/en.js'
|
||||
import { mainConfig_zh_Hans, defaultThemeConfig_zh_Hans } from './l10n_configs/zh-Hans.js'
|
||||
|
||||
export const mainConfig: SiteLocaleConfig = {
|
||||
'/': mainConfig_en,
|
||||
'/zh-Hans/': mainConfig_zh_Hans,
|
||||
}
|
||||
|
||||
export const defaultThemeConfig: LocaleConfig = {
|
||||
'/': defaultThemeConfig_en,
|
||||
'/zh-Hans/': defaultThemeConfig_zh_Hans,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue