Skip to content

Commit 60af863

Browse files
authored
Merge pull request #1169 from vuejs-translations/sync
Sync(autopr) #e4641141 — upstream merge & translate
2 parents c2715ff + 16524f5 commit 60af863

73 files changed

Lines changed: 4031 additions & 1297 deletions

Some content is hidden

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

.github/scripts/auto-pr/prompts/translation.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,25 +164,29 @@
164164

165165
> 自然语言翻译为中文,URL 更新为新地址但不翻译。
166166
167-
### 示例 6:链接列表 (翻译链接文本,保留 URL)
167+
### 示例 6:链接列表 (翻译链接文本,转为中文版本的 URL)
168+
169+
**英文版本的 `vite.dev` 和中文版本 `cn.vite.dev` 的映射**
170+
171+
- `https://vite.dev` => `https://cn.vite.dev`
168172

169173
```json
170174
{
171-
"current": "- [Vite 生产环境指南](https://cn.vitejs.dev/guide/build.html)\n- [Vite 部署指南](https://cn.vitejs.dev/guide/static-deploy.html)",
175+
"current": "- [Vite 生产环境指南](https://cn.vite.dev/guide/build.html)\n- [Vite 部署指南](https://cn.vite.dev/guide/static-deploy.html)",
172176
"incoming": "- [Vite production build guide](https://vite.dev/guide/build.html)\n- [Vite deployment guide](https://vite.dev/guide/static-deploy.html)",
173-
"review": "- [Vite 生产环境构建指南](https://vite.dev/guide/build.html)\n- [Vite 部署指南](https://vite.dev/guide/static-deploy.html)"
177+
"review": "- [Vite 生产环境构建指南](https://vite.dev/guide/build.html)\n- [Vite 部署指南](https://cn.vite.dev/guide/static-deploy.html)"
174178
}
175179
```
176180

177-
> 链接文本是自然语言,必须翻译。URL 更新为新地址
181+
> 链接文本是自然语言,必须翻译。URL 更新为新的中文地址
178182
179-
### 示例 7:代码注释 (翻译注释内容)
183+
### 示例 7:代码注释 (翻译注释内容,并转为中文版本的 URL)
180184

181185
```json
182186
{
183-
"current": "// 确保只在服务端渲染时调用\n // https://cn.vitejs.dev/guide/ssr.html#conditional-logic",
187+
"current": "// 确保只在服务端渲染时调用\n // https://cn.vite.dev/guide/ssr.html#conditional-logic",
184188
"incoming": "// make sure to only call it during SSR\n // https://vite.dev/guide/ssr.html#conditional-logic",
185-
"review": "// 确保只在服务端渲染时调用\n // https://vite.dev/guide/ssr.html#conditional-logic"
189+
"review": "// 确保只在服务端渲染时调用\n // https://cn.vite.dev/guide/ssr.html#conditional-logic"
186190
}
187191
```
188192

.github/scripts/auto-pr/src/create-pr-and-review.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ export function buildPrBody({
3737
ignoreGlobs = "",
3838
detectChangedFiles = "",
3939
}) {
40-
let body = `## Upstream Sync\n\n- Upstream: \`${upstreamRepo}\` @ \`${upstreamHash}\`\n- Merge result: \`${mergeResult}\`\n`;
40+
let body = `## Upstream Sync\n\n`;
4141

4242
if (syncBaseHash && upstreamHash) {
43-
body += `\n- [View upstream changes](https://github.com/${upstreamRepo}/compare/${syncBaseHash}...${upstreamHash})\n`;
43+
body += `- Upstream: https://github.com/${upstreamRepo}/compare/${syncBaseHash}...${upstreamHash}`;
4444
}
4545

46+
body += `\n- Merge result: \`${mergeResult}\`\n`;
47+
4648
body += `\n\n## Changes\n`;
4749

4850
if (conflictFiles) {

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.vitepress/config.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import {
1818
const nav: ThemeConfig['nav'] = [
1919
{
2020
text: '文档',
21-
activeMatch: `^/(guide|style-guide|cookbook|examples)/`,
21+
activeMatch: `^/(guide|tutorial|examples|api|glossary|error-reference)/`,
2222
items: [
23+
{ text: '快速上手', link: '/guide/quick-start' },
2324
{ text: '深度指南', link: '/guide/introduction' },
2425
{ text: '互动教程', link: '/tutorial/' },
2526
{ text: '示例', link: '/examples/' },
26-
{ text: '快速上手', link: '/guide/quick-start' },
27+
{ text: 'API', link: '/api/' },
2728
// { text: '风格指南', link: '/style-guide/' },
2829
{ text: '术语表', link: '/glossary/' },
2930
{ text: '错误码参照表', link: '/error-reference/' },
@@ -37,11 +38,6 @@ const nav: ThemeConfig['nav'] = [
3738
}
3839
]
3940
},
40-
{
41-
text: 'API',
42-
activeMatch: `^/api/`,
43-
link: '/api/'
44-
},
4541
{
4642
text: '演练场',
4743
link: 'https://play.vuejs.org'
@@ -53,7 +49,6 @@ const nav: ThemeConfig['nav'] = [
5349
{
5450
text: '资源',
5551
items: [
56-
{ text: '合作伙伴', link: '/partners/' },
5752
{ text: '主题', link: '/ecosystem/themes' },
5853
{ text: 'UI 组件', link: 'https://ui-libs.vercel.app/' },
5954
{
@@ -134,13 +129,12 @@ const nav: ThemeConfig['nav'] = [
134129
]
135130
},
136131
{
137-
text: '赞助',
138-
link: '/sponsor/'
139-
},
140-
{
141-
text: '合作伙伴',
142-
activeMatch: `^/partners/`,
143-
link: '/partners/'
132+
text: '支持',
133+
activeMatch: `^/(sponsor|partners)/`,
134+
items: [
135+
{ text: 'Sponsor', link: '/sponsor/' },
136+
{ text: 'Partners', link: '/partners/' }
137+
]
144138
}
145139
]
146140

@@ -702,6 +696,11 @@ export default defineConfigWithTheme<ThemeConfig>({
702696
text: 'Français',
703697
repo: 'https://github.com/vuejs-translations/docs-fr'
704698
},
699+
{
700+
link: 'https://de.vuejs.org',
701+
text: 'Deutsch',
702+
repo: 'https://github.com/vuejs-translations/docs-de'
703+
},
705704
{
706705
link: 'https://ko.vuejs.org',
707706
text: '한국어',

.vitepress/theme/components/CardList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { computed, onMounted, ref, shallowRef } from 'vue'
44
const props = withDefaults(
55
defineProps<{
66
items: Array<any>
7-
filter?: (item: any) => boolean
7+
filter?: (item: any) => boolean | undefined
88
cardComponent: any
99
showLinkToAll?: boolean
1010
shuffleItems?: boolean

.vitepress/theme/components/Home.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,22 @@ onMounted(load)
8989

9090
<section id="highlights" class="vt-box-container">
9191
<div class="vt-box">
92-
<h2>易学易用</h2>
92+
<h2>灵活多变</h2>
9393
<p>
94-
基于标准 HTML、CSS 和 JavaScript 构建,提供容易上手的 API
95-
和一流的文档。
94+
丰富的、可渐进式集成的生态系统,可以根据应用规模在库和框架间切换自如。
9695
</p>
9796
</div>
9897
<div class="vt-box">
9998
<h2>性能出色</h2>
100-
<p>经过编译器优化、完全响应式的渲染系统,几乎不需要手动优化。</p>
99+
<p>
100+
经过编译器优化、完全响应式的渲染系统,几乎不需要手动优化。
101+
</p>
101102
</div>
102103
<div class="vt-box">
103-
<h2>灵活多变</h2>
104+
<h2>易学易用</h2>
104105
<p>
105-
丰富的、可渐进式集成的生态系统,可以根据应用规模在库和框架间切换自如。
106+
基于标准 HTML、CSS 和 JavaScript 构建,提供容易上手的 API
107+
和一流的文档。
106108
</p>
107109
</div>
108110
</section>
@@ -336,6 +338,10 @@ html:not(.dark) .accent,
336338
background-color: transparent;
337339
}
338340
341+
#highlights .vt-box h2::first-letter{
342+
color: var(--vt-c-green);
343+
}
344+
339345
#spsrs {
340346
max-width: 900px;
341347
margin: 0px auto;

.vitepress/theme/components/NewsLetter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { VTLink } from '@vue/theme'
4545
href="https://news.vuejs.org/"
4646
no-icon
4747
>news.vuejs.org</VTLink> 阅读之前的期刊并收听我们的播客。你也可以在
48-
<VTLink class="link" href="https://twitter.com/vuejs" no-icon>Twitter</VTLink> 关注我们,或加入我们的
48+
<VTLink class="link" href="https://x.com/vuejs" no-icon>Twitter</VTLink> 关注我们,或加入我们的
4949
<VTLink class="link" href="https://discord.com/invite/vue" no-icon>Discord</VTLink> 家园。
5050
</p>
5151
</div>

.vitepress/theme/components/PreferenceTooltip.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { page } = useData()
1313
type Source = 'url-query' | 'url-header' | 'default'
1414
let source: Source | false =
1515
inBrowser && localStorage.getItem(preferCompositionKey) === null
16-
? 'default'
16+
? 'default' as Source
1717
: false
1818
1919
if (inBrowser) {
@@ -104,7 +104,7 @@ function dismiss() {
104104
一些页面根据所选的 API 风格将包含不同的内容。可以通过此开关在它们之间切换。
105105
</p>
106106
</template>
107-
<template v-if="source && source.startsWith('url')">
107+
<template v-else-if="source && source.startsWith('url')">
108108
<p>
109109
正在显示
110110
{{ preferComposition ? '组合式' : '选项式' }} API 的内容,这是因为

.vitepress/theme/components/SiteMap.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ const items = nav
6262
6363
#sitemap .vt-link {
6464
font-size: 0.9em;
65-
color: var(--vt-c-text-2);
65+
/* increased contrast for better legibility (WCAG 1.4.3) */
66+
color: var(--vt-c-text-1);
67+
opacity: 0.75;
6668
}
6769
</style>

.vitepress/theme/components/VueSchoolLink.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default {
2323
margin: 28px 0;
2424
background-color: var(--vt-c-bg-soft);
2525
padding: 1em 1.25em;
26-
border-radius: 2px;
2726
position: relative;
2827
display: flex;
2928
border-radius: 8px;

0 commit comments

Comments
 (0)