Skip to content

Commit 5e7c524

Browse files
authored
chapter: internationalization add zh_CN (#34)
* doc: add zh * chore: lint
1 parent 9b775cb commit 5e7c524

File tree

6 files changed

+73
-1
lines changed

6 files changed

+73
-1
lines changed

packages/.vitepress/config/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import { defineConfig } from 'vitepress'
33
import { sharedConfig } from './shared'
44
import { ja } from './ja'
55
import { en } from './en'
6+
import { zh } from './zh'
67

7-
export type i18nTheme = Partial<NonNullable<UserConfig<DefaultTheme.Config>['themeConfig']>>
8+
export type i18nTheme = Partial<
9+
NonNullable<UserConfig<DefaultTheme.Config>['themeConfig']>
10+
>
811

912
export default defineConfig({
1013
...sharedConfig,
1114
themeConfig: sharedConfig.themeConfig,
1215
locales: {
1316
root: { label: 'English', lang: 'en', themeConfig: { ...en } },
1417
ja: { label: '日本語', lang: 'ja', themeConfig: { ...ja } },
18+
zh: { label: '简体中文', lang: ' zh', themeConfig: { ...zh } },
1519
// other languages...
1620
},
1721
})

packages/.vitepress/config/zh.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { i18nTheme } from '.'
2+
3+
const nav: i18nTheme['nav'] = [
4+
{ text: '首页', link: '/zh/' },
5+
{ text: '指南', link: '/zh/guide/' },
6+
]
7+
8+
const sidebar: i18nTheme['sidebar'] = [
9+
{ text: '快速开始', link: '/zh/guide/' },
10+
{ text: 'VueUse 是什么?', link: '/zh/guide/what-is-vueuse' },
11+
{ text: '初始化', link: '/zh/guide/setup' },
12+
]
13+
14+
export const zh: i18nTheme = { nav, sidebar }

packages/zh/guide/index.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## 本书的目的
2+
3+
本书的主要目的如下:
4+
5+
- 学会创建像 VueUse 一样注重"可重用性"、"可维护性"和"可扩展性"的可组合组件
6+
- 通过实际创建各种功能的可组合组件,深入理解 Vue.js 和 TypeScript
7+
- 阅读开源代码,学习实用的编码技术和最佳实践
8+
9+
## 本书的方针
10+
11+
- **最小化复现**: 不会完全复现 VueUse 的可组合组件,而是只实现必要的最小功能,以保持代码的可读性。
12+
- **易于理解**: 即使是复杂的概念,也会以易于理解的方式进行解释,让读者能够顺利学习。使用清晰的解释和具体的例子,帮助读者顺利理解。
13+
- **实用性**: 注重所学知识在实际开发中的应用价值。不仅关注理论知识,还会重点介绍实践问题解决方法和最佳实践。
14+
15+
## 目标读者
16+
17+
- 有 Vue.js 使用经验
18+
- 有 TypeScript 使用经验
19+
20+
## 本书的结构
21+
22+
<!-- TODO: write about book structure -->

packages/zh/guide/setup.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 环境搭建
2+
3+
<!-- TODO: write how to setup -->

packages/zh/guide/what-is-vueuse.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 什么是 VueUse?
2+
3+
<!-- TODO: write what is vueuse -->

packages/zh/index.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: home
4+
5+
hero:
6+
name: "VueYous"
7+
text: "从头开始打造自己的 VueUse"
8+
tagline: 由 VitePress 驱动
9+
image: /logo.png
10+
actions:
11+
- theme: brand
12+
text: 快速上手
13+
link: /zh/guide/
14+
- theme: alt
15+
text: VueUse 官方
16+
link: https://vueuse.org/
17+
18+
# TODO: Write features
19+
features:
20+
- title: Feature A
21+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22+
- title: Feature B
23+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24+
- title: Feature C
25+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
26+
---

0 commit comments

Comments
 (0)