Skip to content

Commit 5b356dc

Browse files
committed
translation: add the Chinese translation link and categorize files
1 parent ce3f418 commit 5b356dc

Some content is hidden

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

42 files changed

+627
-150
lines changed

.vitepress/config.js

Lines changed: 4 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,10 @@
1+
import locales from './locales'
2+
13
export default {
2-
title: 'Vue 3 Migration Guide',
3-
description: 'Guide on migrating from Vue 2 to Vue 3',
44
srcDir: 'src',
5+
locales: locales.vitepressConfig,
56

67
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-
]
8+
locales: locales.themeConfig
1559
}
15610
}

.vitepress/locales/en.js

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

.vitepress/locales/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import en from './en.js'
2+
import zh from './zh.js'
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)