Skip to content

Commit a748090

Browse files
authored
Merge pull request #20 from zhousg/translation-zh
translation: init locales config and create missing md file
2 parents ce3f418 + 7eb6763 commit a748090

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+563
-151
lines changed

.vitepress/config.js

+14-150
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,20 @@
1+
import locales from "./locales"
2+
3+
/**
4+
* @type {import('vitepress').UserConfig}
5+
*/
16
export default {
2-
title: 'Vue 3 Migration Guide',
3-
description: 'Guide on migrating from Vue 2 to Vue 3',
47
srcDir: 'src',
8+
locales: locales.vitepressConfig,
9+
510

611
themeConfig: {
7-
nav: [{ text: 'Vue 3 Docs', link: 'https://vuejs.org' }],
8-
9-
sidebar: [
10-
{
11-
text: 'Guide',
12-
items: [
13-
{ text: 'Overview', link: '/' },
14-
{ text: 'New Recommendations', link: '/recommendations' },
15-
{ text: 'Migration Build', link: '/migration-build' },
16-
{
17-
text: 'Breaking Changes',
18-
link: '/breaking-changes/'
19-
}
20-
]
21-
},
22-
{
23-
text: 'Global API',
24-
items: [
25-
{
26-
text: 'Global API Application Instance',
27-
link: '/breaking-changes/global-api'
28-
},
29-
{
30-
text: 'Global API Treeshaking',
31-
link: '/breaking-changes/global-api-treeshaking'
32-
}
33-
]
34-
},
35-
{
36-
text: 'Template Directives',
37-
items: [
38-
{ text: 'v-model', link: '/breaking-changes/v-model' },
39-
{
40-
text: 'key Usage Change',
41-
link: '/breaking-changes/key-attribute'
42-
},
43-
{
44-
text: 'v-if vs. v-for Precedence',
45-
link: '/breaking-changes/v-if-v-for'
46-
},
47-
{ text: 'v-bind Merge Behavior', link: '/breaking-changes/v-bind' },
48-
{
49-
text: 'v-on.native modifier removed',
50-
link: '/breaking-changes/v-on-native-modifier-removed'
51-
}
52-
]
53-
},
54-
{
55-
text: 'Components',
56-
items: [
57-
{
58-
text: 'Functional Components',
59-
link: '/breaking-changes/functional-components'
60-
},
61-
{
62-
text: 'Async Components',
63-
link: '/breaking-changes/async-components'
64-
},
65-
{ text: 'emits Option', link: '/breaking-changes/emits-option' }
66-
]
67-
},
68-
{
69-
text: 'Render Function',
70-
items: [
71-
{
72-
text: 'Render Function API',
73-
link: '/breaking-changes/render-function-api'
74-
},
75-
{
76-
text: 'Slots Unification',
77-
link: '/breaking-changes/slots-unification'
78-
},
79-
{
80-
text: '$listeners merged into $attrs',
81-
link: '/breaking-changes/listeners-removed'
82-
},
83-
{
84-
text: '$attrs includes class & style',
85-
link: '/breaking-changes/attrs-includes-class-style'
86-
}
87-
]
88-
},
89-
{
90-
text: 'Custom Elements',
91-
items: [
92-
{
93-
text: 'Custom Elements Interop Changes',
94-
link: '/breaking-changes/custom-elements-interop'
95-
}
96-
]
97-
},
98-
{
99-
text: 'Removed APIs',
100-
items: [
101-
{
102-
text: 'v-on keyCode Modifiers',
103-
link: '/breaking-changes/keycode-modifiers'
104-
},
105-
{ text: 'Events API', link: '/breaking-changes/events-api' },
106-
{ text: 'Filters', link: '/breaking-changes/filters' },
107-
{
108-
text: 'inline-template',
109-
link: '/breaking-changes/inline-template-attribute'
110-
},
111-
{ text: '$children', link: '/breaking-changes/children' },
112-
{ text: 'propsData option', link: '/breaking-changes/props-data' }
113-
]
114-
},
115-
{
116-
text: 'Other Minor Changes',
117-
items: [
118-
{
119-
text: 'Attribute Coercion Behavior',
120-
link: '/breaking-changes/attribute-coercion'
121-
},
122-
{
123-
text: 'Custom Directives',
124-
link: '/breaking-changes/custom-directives'
125-
},
126-
{ text: 'Data Option', link: '/breaking-changes/data-option' },
127-
{
128-
text: 'Mount API changes',
129-
link: '/breaking-changes/mount-changes'
130-
},
131-
{
132-
text: 'Props Default Function this Access',
133-
link: '/breaking-changes/props-default-this'
134-
},
135-
{
136-
text: 'Transition Class Change',
137-
link: '/breaking-changes/transition'
138-
},
139-
{
140-
text: 'Transition as Root',
141-
link: '/breaking-changes/transition-as-root'
142-
},
143-
{
144-
text: 'Transition Group Root Element',
145-
link: '/breaking-changes/transition-group'
146-
},
147-
{
148-
text: 'VNode lifecycle events',
149-
link: '/breaking-changes/vnode-lifecycle-events'
150-
},
151-
{ text: 'Watch on Arrays', link: '/breaking-changes/watch' }
152-
]
153-
}
154-
]
12+
localeLinks: {
13+
items: [
14+
{text: 'English', link: '/'},
15+
{text: '中文简体', link: '/zh/'}
16+
]
17+
},
18+
locales: locales.themeConfig
15519
}
15620
}

.vitepress/locales/en.js

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
export default {
2+
vitepressConfig: {
3+
title: 'Vue 3 Migration Guide',
4+
description: 'Guide on migrating from Vue 2 to Vue 3',
5+
lang: 'en-US'
6+
},
7+
themeConfig: {
8+
nav: [
9+
{ text: 'Vue 3 Docs', link: 'https://vuejs.org' },
10+
],
11+
12+
sidebar: [
13+
{
14+
text: 'Guide',
15+
items: [
16+
{ text: 'Overview', link: '/' },
17+
{ text: 'New Recommendations', link: '/recommendations' },
18+
{ text: 'Migration Build', link: '/migration-build' },
19+
{
20+
text: 'Breaking Changes',
21+
link: '/breaking-changes/'
22+
}
23+
]
24+
},
25+
{
26+
text: 'Global API',
27+
items: [
28+
{
29+
text: 'Global API Application Instance',
30+
link: '/breaking-changes/global-api'
31+
},
32+
{
33+
text: 'Global API Treeshaking',
34+
link: '/breaking-changes/global-api-treeshaking'
35+
}
36+
]
37+
},
38+
{
39+
text: 'Template Directives',
40+
items: [
41+
{ text: 'v-model', link: '/breaking-changes/v-model' },
42+
{
43+
text: 'key Usage Change',
44+
link: '/breaking-changes/key-attribute'
45+
},
46+
{
47+
text: 'v-if vs. v-for Precedence',
48+
link: '/breaking-changes/v-if-v-for'
49+
},
50+
{ text: 'v-bind Merge Behavior', link: '/breaking-changes/v-bind' },
51+
{
52+
text: 'v-on.native modifier removed',
53+
link: '/breaking-changes/v-on-native-modifier-removed'
54+
}
55+
]
56+
},
57+
{
58+
text: 'Components',
59+
items: [
60+
{
61+
text: 'Functional Components',
62+
link: '/breaking-changes/functional-components'
63+
},
64+
{
65+
text: 'Async Components',
66+
link: '/breaking-changes/async-components'
67+
},
68+
{ text: 'emits Option', link: '/breaking-changes/emits-option' }
69+
]
70+
},
71+
{
72+
text: 'Render Function',
73+
items: [
74+
{
75+
text: 'Render Function API',
76+
link: '/breaking-changes/render-function-api'
77+
},
78+
{
79+
text: 'Slots Unification',
80+
link: '/breaking-changes/slots-unification'
81+
},
82+
{
83+
text: '$listeners merged into $attrs',
84+
link: '/breaking-changes/listeners-removed'
85+
},
86+
{
87+
text: '$attrs includes class & style',
88+
link: '/breaking-changes/attrs-includes-class-style'
89+
}
90+
]
91+
},
92+
{
93+
text: 'Custom Elements',
94+
items: [
95+
{
96+
text: 'Custom Elements Interop Changes',
97+
link: '/breaking-changes/custom-elements-interop'
98+
}
99+
]
100+
},
101+
{
102+
text: 'Removed APIs',
103+
items: [
104+
{
105+
text: 'v-on keyCode Modifiers',
106+
link: '/breaking-changes/keycode-modifiers'
107+
},
108+
{ text: 'Events API', link: '/breaking-changes/events-api' },
109+
{ text: 'Filters', link: '/breaking-changes/filters' },
110+
{
111+
text: 'inline-template',
112+
link: '/breaking-changes/inline-template-attribute'
113+
},
114+
{ text: '$children', link: '/breaking-changes/children' },
115+
{ text: 'propsData option', link: '/breaking-changes/props-data' }
116+
]
117+
},
118+
{
119+
text: 'Other Minor Changes',
120+
items: [
121+
{
122+
text: 'Attribute Coercion Behavior',
123+
link: '/breaking-changes/attribute-coercion'
124+
},
125+
{
126+
text: 'Custom Directives',
127+
link: '/breaking-changes/custom-directives'
128+
},
129+
{ text: 'Data Option', link: '/breaking-changes/data-option' },
130+
{
131+
text: 'Mount API changes',
132+
link: '/breaking-changes/mount-changes'
133+
},
134+
{
135+
text: 'Props Default Function this Access',
136+
link: '/breaking-changes/props-default-this'
137+
},
138+
{
139+
text: 'Transition Class Change',
140+
link: '/breaking-changes/transition'
141+
},
142+
{
143+
text: 'Transition as Root',
144+
link: '/breaking-changes/transition-as-root'
145+
},
146+
{
147+
text: 'Transition Group Root Element',
148+
link: '/breaking-changes/transition-group'
149+
},
150+
{
151+
text: 'VNode lifecycle events',
152+
link: '/breaking-changes/vnode-lifecycle-events'
153+
},
154+
{ text: 'Watch on Arrays', link: '/breaking-changes/watch' }
155+
]
156+
}
157+
]
158+
}
159+
}

.vitepress/locales/index.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import en from './en'
2+
import zh from './zh'
3+
4+
export default {
5+
vitepressConfig: {
6+
'/': en.vitepressConfig,
7+
'/zh/': zh.vitepressConfig
8+
},
9+
themeConfig: {
10+
'/': en.themeConfig,
11+
'/zh/': zh.themeConfig
12+
}
13+
}

0 commit comments

Comments
 (0)