Skip to content

Commit f2583ff

Browse files
committed
docs: update documentation translations
1 parent bb1b36c commit f2583ff

File tree

512 files changed

+73330
-189
lines changed

Some content is hidden

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

512 files changed

+73330
-189
lines changed

apps/docs/content/zh-hans/docs/01-app/05-api-reference/05-config/01-next-config-js/assetPrefix.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
source-updated-at: 2025-05-16T04:52:11.000Z
3-
translation-updated-at: 2025-05-20T22:59:36.628Z
2+
source-updated-at: 2025-05-21T18:33:43.000Z
3+
translation-updated-at: 2025-05-21T21:08:11.137Z
44
title: assetPrefix
55
description: 了解如何使用 assetPrefix 配置选项来配置您的 CDN。
66
---
@@ -21,14 +21,15 @@ description: 了解如何使用 assetPrefix 配置选项来配置您的 CDN。
2121
2222
</PagesOnly>
2323

24-
> **须知**:Next.js 9.5+ 增加了对可自定义 [基础路径 (Base Path)](/docs/app/api-reference/config/next-config-js/basePath) 的支持,该功能更适合将应用程序托管在子路径(如 `/docs`)下。
25-
> 我们不建议您为此用例使用自定义资源前缀 (Asset Prefix)。
24+
> **须知**:Next.js 9.5+ 添加了对可自定义 [基础路径 (Base Path)](/docs/app/api-reference/config/next-config-js/basePath) 的支持,该功能更适合
25+
> 将应用程序托管在子路径(如 `/docs`)下。
26+
> 对于此用例,我们不建议使用自定义资源前缀 (Asset Prefix)。
2627
2728
## 设置 CDN
2829

29-
要设置 [CDN](https://en.wikipedia.org/wiki/Content_delivery_network)您可以配置资源前缀 (assetPrefix) 并将 CDN 的源站解析到托管 Next.js 的域名。
30+
要设置 [CDN](https://en.wikipedia.org/wiki/Content_delivery_network)您可以配置资源前缀并将 CDN 的源站解析到托管 Next.js 的域名。
3031

31-
打开 `next.config.mjs` 并根据 [阶段 (phase)](/docs/app/api-reference/config/next-config-js#async-configuration) 添加 `assetPrefix` 配置:
32+
打开 `next.config.mjs` 并根据 [阶段](/docs/app/api-reference/config/next-config-js#async-configuration) 添加 `assetPrefix` 配置:
3233

3334
```js filename="next.config.mjs"
3435
// @ts-check
@@ -46,7 +47,7 @@ export default (phase) => {
4647
}
4748
```
4849

49-
Next.js 会自动将您配置的资源前缀用于从 `/_next/` 路径(`.next/static/` 文件夹)加载的 JavaScript 和 CSS 文件。例如,使用上述配置后,以下对 JS 分块的请求
50+
Next.js 会自动对从 `/_next/` 路径(`.next/static/` 文件夹)加载的 JavaScript 和 CSS 文件使用您配置的资源前缀。例如,使用上述配置后,原本的 JS 块请求
5051

5152
```
5253
/_next/static/chunks/4b9b41aaa062cbbfeff4add70f256968c51ece5d.4d708494b3aed70c04f0.js
@@ -58,7 +59,7 @@ Next.js 会自动将您配置的资源前缀用于从 `/_next/` 路径(`.next/
5859
https://cdn.mydomain.com/_next/static/chunks/4b9b41aaa062cbbfeff4add70f256968c51ece5d.4d708494b3aed70c04f0.js
5960
```
6061

61-
将文件上传到指定 CDN 的具体配置取决于您选择的 CDN。您只需要在 CDN 上托管 `.next/static/` 文件夹的内容,这些内容应按照上述 URL 请求所示上传为 `_next/static/`**不要上传 `.next/` 文件夹的其他部分**因为您不应将服务器代码和其他配置暴露给公众
62+
将文件上传到指定 CDN 的具体配置取决于您选择的 CDN 服务。您只需要在 CDN 上托管 `.next/static/` 目录的内容,并按照上述 URL 请求所示将其上传为 `_next/static/`**请勿上传 `.next/` 文件夹的其他部分**因为您不应将服务器代码和其他配置公开给公众
6263

6364
虽然 `assetPrefix` 会覆盖对 `_next/static` 的请求,但它不会影响以下路径:
6465

@@ -72,6 +73,6 @@ https://cdn.mydomain.com/_next/static/chunks/4b9b41aaa062cbbfeff4add70f256968c51
7273

7374
- [public](/docs/pages/api-reference/file-conventions/public-folder) 文件夹中的文件;如果您想通过 CDN 提供这些资源,需要自行添加前缀
7475
- 针对 `getServerSideProps` 页面的 `/_next/data/` 请求。这些请求始终会针对主域名发起,因为它们不是静态的。
75-
- 针对 `getStaticProps` 页面的 `/_next/data/` 请求。这些请求始终会针对主域名发起,以支持 [增量静态生成 (Incremental Static Generation)](/docs/pages/building-your-application/data-fetching/incremental-static-regeneration),即使您没有使用该功能(为了保持一致性)。
76+
- 针对 `getStaticProps` 页面的 `/_next/data/` 请求。这些请求始终会针对主域名发起以支持 [增量静态生成 (Incremental Static Generation)](/docs/pages/guides/incremental-static-regeneration),即使您没有使用该功能(为了保持一致性)。
7677

7778
</PagesOnly>

apps/docs/content/zh-hans/docs/01-app/05-api-reference/05-config/01-next-config-js/headers.mdx

Lines changed: 52 additions & 53 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
---
2-
source-updated-at: 2025-05-16T04:52:11.000Z
3-
translation-updated-at: 2025-05-20T22:58:10.218Z
2+
source-updated-at: 2025-05-21T18:33:43.000Z
3+
translation-updated-at: 2025-05-21T21:07:36.410Z
44
title: htmlLimitedBots
55
description: 指定应接收阻塞元数据的用户代理列表。
66
---
77

8-
`htmlLimitedBots` 配置允许您指定一组应接收阻塞元数据而非 [流式元数据](/docs/app/api-reference/functions/generate-metadata#streaming-metadata) 的用户代理
8+
`htmlLimitedBots` 配置允许您指定应接收阻塞元数据而非 [流式元数据](/docs/app/api-reference/functions/generate-metadata#streaming-metadata) 的用户代理列表
99

1010
```ts filename="next.config.ts" switcher
1111
import type { NextConfig } from 'next'
1212

1313
const config: NextConfig = {
14-
htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
14+
htmlLimitedBots: /MySpecialBot|MyAnotherSpecialBot|SimpleCrawler/,
1515
}
1616

1717
export default config
1818
```
1919

2020
```js filename="next.config.js" switcher
2121
module.exports = {
22-
htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
22+
htmlLimitedBots: /MySpecialBot|MyAnotherSpecialBot|SimpleCrawler/,
2323
}
2424
```
2525

2626
## 默认列表
2727

28-
Next.js 内置了 [HTML 受限机器人的默认列表](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/html-bots.ts)
28+
Next.js 内置了 [HTML 受限爬虫的默认列表](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/html-bots.ts)
2929

30-
指定 `htmlLimitedBots` 配置会覆盖 Next.js 的默认列表,使您可以完全控制哪些用户代理应启用此行为。不过这是高级用法,默认列表在大多数情况下已足够使用
30+
指定 `htmlLimitedBots` 配置将覆盖 Next.js 的默认列表,使您可以完全控制哪些用户代理应启用此行为。不过这是高级用法,在大多数情况下默认列表已经足够
3131

3232
## 版本历史
3333

34-
| 版本 | 变更说明 |
35-
| ------- | ------------------------------------ |
36-
| 15.2.0 | 新增 `htmlLimitedBots` 配置选项。 |
34+
| 版本 | 变更说明 |
35+
| ------- | --------------------------------- |
36+
| 15.2.0 | 新增 `htmlLimitedBots` 配置选项。 |
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
source-updated-at: 2025-05-16T04:52:11.000Z
3-
translation-updated-at: 2025-05-20T22:58:13.280Z
2+
source-updated-at: 2025-05-21T18:33:43.000Z
3+
translation-updated-at: 2025-05-21T21:07:50.596Z
44
title: 自定义 Next.js 缓存处理器
55
nav_title: cacheHandler
66
description: 配置 Next.js 用于存储和重新验证数据的缓存,以使用 Redis、Memcached 或其他任何外部服务。
@@ -15,47 +15,47 @@ module.exports = {
1515
}
1616
```
1717

18-
查看[自定义缓存处理器](/docs/app/guides/self-hosting#configuring-caching)的示例并了解更多实现细节。
18+
查看 [自定义缓存处理器](/docs/app/guides/self-hosting#configuring-caching) 的示例并了解更多实现细节。
1919

2020
## API 参考
2121

2222
缓存处理器可以实现以下方法:`get``set``revalidateTag``resetRequestCache`
2323

2424
### `get()`
2525

26-
| 参数 | 类型 | 描述 |
27-
| --------- | ---------- | --------------------- |
28-
| `key` | `string` | 缓存值的键名。 |
26+
| 参数 | 类型 | 描述 |
27+
| --------- | ---------- | ---------------------- |
28+
| `key` | `string` | 缓存值的键名。 |
2929

3030
返回缓存值,如果未找到则返回 `null`
3131

3232
### `set()`
3333

34-
| 参数 | 类型 | 描述 |
35-
| --------- | ---------------- | ------------------------- |
36-
| `key` | `string` | 存储数据的键名。 |
37-
| `data` | Data 或 `null` | 要缓存的数据。 |
38-
| `ctx` | `{ tags: [] }` | 提供的缓存标签。 |
34+
| 参数 | 类型 | 描述 |
35+
| --------- | ---------------- | ------------------------ |
36+
| `key` | `string` | 存储数据的键名。 |
37+
| `data` | Data 或 `null` | 要缓存的数据。 |
38+
| `ctx` | `{ tags: [] }` | 提供的缓存标签。 |
3939

4040
返回 `Promise<void>`
4141

4242
### `revalidateTag()`
4343

4444
| 参数 | 类型 | 描述 |
4545
| --------- | ------------------------ | ---------------------- |
46-
| `tag` | `string``string[]` | 需要重新验证的缓存标签。|
46+
| `tag` | `string``string[]` | 需要重新验证的缓存标签。 |
4747

48-
返回 `Promise<void>`。了解更多关于[重新验证数据](/docs/app/building-your-application/data-fetching/incremental-static-regeneration)[`revalidateTag()`](/docs/app/api-reference/functions/revalidateTag) 函数的信息。
48+
返回 `Promise<void>`。了解更多关于 [重新验证数据](/docs/app/guides/incremental-static-regeneration) [`revalidateTag()`](/docs/app/api-reference/functions/revalidateTag) 函数的信息。
4949

5050
### `resetRequestCache()`
5151

52-
此方法在下一次请求之前重置单个请求的临时内存缓存
52+
此方法在下一个请求之前重置单个请求的临时内存缓存
5353

5454
返回 `void`
5555

5656
**须知:**
5757

58-
- `revalidatePath` 是缓存标签之上的便捷层。调用 `revalidatePath` 会调用您的 `revalidateTag` 函数,然后您可以选择是否根据路径标记缓存键
58+
- `revalidatePath` 是缓存标签之上的便捷层。调用 `revalidatePath` 会调用您的 `revalidateTag` 函数,然后您可以选择是否基于路径标记缓存键
5959

6060
## 平台支持
6161

@@ -64,15 +64,15 @@ module.exports = {
6464
| [Node.js 服务器](/docs/app/getting-started/deploying#nodejs-server) ||
6565
| [Docker 容器](/docs/app/getting-started/deploying#docker) ||
6666
| [静态导出](/docs/app/getting-started/deploying#static-export) ||
67-
| [适配器](/docs/app/getting-started/deploying#adapters) | 视平台而定 |
67+
| [适配器](/docs/app/getting-started/deploying#adapters) | 平台相关 |
6868

69-
了解在自托管 Next.js 时如何[配置 ISR](/docs/app/guides/self-hosting#caching-and-isr)
69+
了解在自托管 Next.js 时如何 [配置 ISR](/docs/app/guides/self-hosting#caching-and-isr)
7070

7171
## 版本历史
7272

7373
| 版本 | 变更 |
7474
| ---------- | -------------------------------------------------------- |
75-
| `v14.1.0` | 重命名为 `cacheHandler` 并成为稳定功能。 |
76-
| `v13.4.0` | `incrementalCacheHandlerPath` 支持 `revalidateTag`|
77-
| `v13.4.0` | `incrementalCacheHandlerPath` 支持独立输出。 |
78-
| `v12.2.0` | 实验性添加 `incrementalCacheHandlerPath`|
75+
| `v14.1.0` | 重命名为 `cacheHandler` 并成为稳定功能。 |
76+
| `v13.4.0` | `incrementalCacheHandlerPath` 支持 `revalidateTag`|
77+
| `v13.4.0` | `incrementalCacheHandlerPath` 支持独立输出。 |
78+
| `v12.2.0` | 实验性添加 `incrementalCacheHandlerPath`|

0 commit comments

Comments
 (0)