添加日语支持,更新多语言导航和首页链接

This commit is contained in:
远野千束(神羽) 2024-12-15 22:56:41 +08:00
parent 26fe0e9b23
commit ebcdffade0
8 changed files with 75 additions and 7 deletions

View File

@ -9,6 +9,11 @@ export const en = defineConfig({
prev: 'Prev', prev: 'Prev',
next: 'Next' next: 'Next'
}, },
nav: [
{text: 'Home', link: '/en'},
{text: 'Usage', link: '/en/start/install'},
{text: 'Develop', link: '/en/dev/extension'},
],
langMenuLabel: 'Language', langMenuLabel: 'Language',
returnToTopLabel: 'To top', returnToTopLabel: 'To top',
sidebarMenuLabel: 'Option', sidebarMenuLabel: 'Option',

View File

@ -1,6 +1,7 @@
import { defineConfig } from 'vitepress' import { defineConfig } from 'vitepress'
import { zh } from './zh' import { zh } from './zh'
import { en } from './en' import { en } from './en'
import { ja } from './ja'
import { defaultLang, generateSidebarConfig, gitea } from './common' import { defaultLang, generateSidebarConfig, gitea } from './common'
import { generateSidebar } from 'vitepress-sidebar' import { generateSidebar } from 'vitepress-sidebar'
@ -33,5 +34,6 @@ export default defineConfig({
locales: { locales: {
root: { label: "简体中文", ...zh }, root: { label: "简体中文", ...zh },
en: { label: "English", ...en }, en: { label: "English", ...en },
ja: { label: "日本語", ...ja },
}, },
}) })

View File

@ -0,0 +1,24 @@
import {defineConfig} from 'vitepress'
export const ja = defineConfig({
lang: "ja-JP",
title: "Marsho AI",
description: "かわいくて、賢くて、拡張しやすい",
themeConfig: {
docFooter: {
prev: '前へ',
next: '次へ'
},
nav: [
{text: 'ホーム', link: '/ja'},
{text: '使用方法', link: '/ja/start/install'},
{text: '開発', link: '/ja/dev/extension'},
],
langMenuLabel: '言語',
returnToTopLabel: 'トップへ戻る',
sidebarMenuLabel: 'オプション',
darkModeSwitchLabel: 'テーマ',
lightModeSwitchTitle: 'ライト',
darkModeSwitchTitle: 'ダーク',
},
})

View File

@ -9,11 +9,20 @@ export const zh = defineConfig({
prev: '上一页', prev: '上一页',
next: '下一页' next: '下一页'
}, },
nav: [
{text: '家', link: '/'},
{text: '使用', link: '/start/install'},
{text: '开发', link: '/dev/extension'},
],
langMenuLabel: '语言', langMenuLabel: '语言',
returnToTopLabel: '返回顶部', returnToTopLabel: '返回顶部',
sidebarMenuLabel: '菜单', sidebarMenuLabel: '菜单',
darkModeSwitchLabel: '主题', darkModeSwitchLabel: '主题',
lightModeSwitchTitle: '轻色模式', lightModeSwitchTitle: '轻色模式',
darkModeSwitchTitle: '深色模式', darkModeSwitchTitle: '深色模式',
footer: {
message: "文档完善中,欢迎提出建议或帮助我们完善。",
copyright: '© 2024 <a href="https://liteyuki.icu" target="_blank">Liteyuki Studio</a>',
}
}, },
}) })

View File

@ -9,13 +9,13 @@ hero:
actions: actions:
- theme: brand - theme: brand
text: Start text: Start
link: /start link: /en/start/install/
- theme: alt - theme: alt
text: Develop & Extened text: Develop & Extened
link: /dev link: /en/dev/extension/
image: image:
light: ./marsho-full.svg light: /marsho-full.svg
dark: ./marsho-full.svg dark: /marsho-full.svg
alt: Marsho Logo alt: Marsho Logo
features: features:

28
docs/ja/index.md Normal file
View File

@ -0,0 +1,28 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "小綿智能"
text: "猫娘ロボット"
tagline: かわいくて、賢くて、拡張可能なAIサービスプラグイン
actions:
- theme: brand
text: 始める
link: /ja/start/install/
- theme: alt
text: 開発と拡張
link: /ja/dev/extension/
image:
light: /marsho-full.svg
dark: /marsho-full.svg
alt: Marshoロゴ
features:
- title: 強力なドライバー
details: NoneBot2に基づいており、既存のNoneBot2またはLiteyukiインスタンスに迅速にインストールできます
- title: インターフェース規格
details: どんなオープンAI標準に従うインターフェースでも小綿智能と対話できます
- title: 簡単に拡張
details: Pythonでツールやプラグインを作成し、関数呼び出しを実現し、小綿智能の機能を簡単に拡張できます
---

View File

@ -83,7 +83,7 @@ def execute_command(command: str) -> str:
## 依赖注入 ## 依赖注入
function call支持NoneBot2原生的会话上下文依赖注入例如Bot、Event等,只需要在函数的参数中声明即可,无需在装饰器中声明。 function call支持NoneBot2原生的会话上下文依赖注入例如Bot、Event等
```python ```python
@on_function_call(description="获取个人信息") @on_function_call(description="获取个人信息")

View File

@ -14,8 +14,8 @@ hero:
text: 开发及扩展 text: 开发及扩展
link: /dev/extension/ link: /dev/extension/
image: image:
light: ./marsho-full.svg light: /marsho-full.svg
dark: ./marsho-full.svg dark: /marsho-full.svg
alt: Marsho Logo alt: Marsho Logo
features: features: