Skip to content

Commit d965a79

Browse files
i18n(zh-cn): Update error-reference.mdx & reference/errors/ (#11537)
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
1 parent 42b7818 commit d965a79

10 files changed

+80
-5
lines changed

src/content/docs/zh-cn/reference/error-reference.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
88

99
## Astro 错误
1010

11-
- [**CantUseAstroConfigModuleError**](/zh-cn/reference/errors/cant-use-astro-config-module-error/)<br/>Cannot use the `astro:config` module without enabling the experimental feature.
1211
- [**UnknownCompilerError**](/zh-cn/reference/errors/unknown-compiler-error/)<br/>Unknown compiler error.
1312
- [**ClientAddressNotAvailable**](/zh-cn/reference/errors/client-address-not-available/)<br/>`Astro.clientAddress` is not available in current adapter.
1413
- [**PrerenderClientAddressNotAvailable**](/zh-cn/reference/errors/prerender-client-address-not-available/)<br/>`Astro.clientAddress` cannot be used inside prerendered routes.
@@ -81,6 +80,11 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
8180
- [**RewriteWithBodyUsed**](/zh-cn/reference/errors/rewrite-with-body-used/)<br/>Cannot use Astro.rewrite after the request body has been read
8281
- [**ForbiddenRewrite**](/zh-cn/reference/errors/forbidden-rewrite/)<br/>Forbidden rewrite to a static route.
8382
- [**UnknownFilesystemError**](/zh-cn/reference/errors/unknown-filesystem-error/)<br/>An unknown error occurred while reading or writing files to disk.
83+
- [**CannotExtractFontType**](/zh-cn/reference/errors/cannot-extract-font-type/)<br/>Cannot extract the font type from the given URL.
84+
- [**CannotFetchFontFile**](/zh-cn/reference/errors/cannot-fetch-font-file/)<br/>Cannot fetch the given font file.
85+
- [**CannotLoadFontProvider**](/zh-cn/reference/errors/cannot-load-font-provider/)<br/>Cannot load font provider
86+
- [**ExperimentalFontsNotEnabled**](/zh-cn/reference/errors/experimental-fonts-not-enabled/)<br/>Experimental fonts are not enabled
87+
- [**FontFamilyNotFound**](/zh-cn/reference/errors/font-family-not-found/)<br/>Font family not found
8488

8589
## CSS 错误
8690

@@ -130,8 +134,8 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/
130134

131135
## Session(会话)错误
132136

133-
- [**SessionWithoutSupportedAdapterOutputError**](/zh-cn/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
134137
- [**SessionStorageInitError**](/zh-cn/reference/errors/session-storage-init-error/)<br/>Session storage could not be initialized.
135138
- [**SessionStorageSaveError**](/zh-cn/reference/errors/session-storage-save-error/)<br/>Session data could not be saved.
139+
- [**SessionWithoutSupportedAdapterOutputError**](/zh-cn/reference/errors/session-without-supported-adapter-output-error/)<br/>Sessions cannot be used with an adapter that doesn't support server output.
136140
- [**SessionConfigMissingError**](/zh-cn/reference/errors/session-config-missing-error/)<br/>Session storage was enabled but not configured.
137141
- [**SessionConfigWithoutFlagError**](/zh-cn/reference/errors/session-config-without-flag-error/)<br/>Session flag not set
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Cannot extract the font type from the given URL.
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> 当尝试从给定 URL 中提取该字体类型时,出现错误。
8+
9+
## 哪里出了问题?
10+
11+
无法从给定 URL 中提取该字体类型。
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Cannot fetch the given font file.
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> 当尝试从给定 URL 中请求字体文件时,出现错误。
8+
9+
## 哪里出了问题?
10+
11+
无法获取给定的字体文件。
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Cannot load font provider
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> Astro 无法加载给定的字体提供商。可在对应的字体提供商仓库中开启一个 issue。
8+
9+
## 哪里出了问题?
10+
11+
无法加载字体提供商。

src/content/docs/zh-cn/reference/errors/cant-use-astro-config-module-error.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ i18nReady: true
44
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
55
---
66

7+
:::caution[已弃用]
8+
该错误来自于旧版本的 Astro,目前已不再适用。如果你无法将自己的项目升级至最近的版本,你可以查看 [不再维护的旧版本文档快照](/zh-cn/upgrade-astro/#旧版本文档不再维护) 来获得帮助。
9+
:::
10+
711
> **CantUseAstroConfigModuleError**: 无法导入模块 "MODULE_NAME",因为实验性功能已禁用。在你的 `astro.config.mjs` 中启用 `experimental.serializeConfig`
812
913
## 哪里出了问题?
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Experimental fonts are not enabled
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> **ExperimentalFontsNotEnabled**:使用了字体组件,但是实验性字体并没有在配置中注册。
8+
9+
## 哪里出了问题?
10+
11+
使用了字体组件,但实验性字体并未在配置中注册(启用)。
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Font family not found
3+
i18nReady: true
4+
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5+
---
6+
7+
> 在字体组件中,被传入的字体系列无数据。
8+
9+
## 哪里出了问题?
10+
11+
字体系列(font family)无数据。

src/content/docs/zh-cn/reference/errors/session-config-missing-error.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ i18nReady: true
44
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
55
---
66

7-
> `experimental.session` 标志被设置为 `true`,但没有配置存储。请要么手动配置存储,要么使用提供会话存储(session storage)的适配器
7+
:::caution[已弃用]
8+
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
9+
:::
10+
11+
> `experimental.session` 标志被设置为 `true`,但没有配置存储。请要么手动配置存储,要么使用提供会话存储(session storage)的适配器。
812
913
## 哪里出了问题?
1014
当启用会话存储但却未进行配置时,抛出错误。

src/content/docs/zh-cn/reference/errors/session-config-without-flag-error.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ i18nReady: true
44
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
55
---
66

7-
> 在没有启用 `experimental.session` 标志的前提下提供了会话(session)配置。
7+
:::caution[已弃用]
8+
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
9+
:::
10+
11+
> 在没有启用 `experimental.session` 标志的前提下提供了会话(Session)配置。
812
913
## 哪里出了问题?
1014
在没有启用 `experimental.session` 标志却进行了会话存储配置时,抛出错误。

src/content/docs/zh-cn/reference/errors/session-without-supported-adapter-output-error.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ i18nReady: true
44
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
55
---
66

7+
:::caution[已弃用]
8+
该错误已在 Astro 5.7 中被移除,会话功能已不再是实验性功能。
9+
:::
10+
711
> **SessionWithoutSupportedAdapterOutputError**: 会话(session)需要一个支持服务器输出的适配器。该适配器必须在其 `buildOutput` 功能中设置为 `"server"`
812
913
## 哪里出了问题?
1014
你的适配器必须支持服务器输出以使用会话。
1115

1216
**另见:**
13-
- [服务器输出适配器构建](/zh-cn/reference/adapter-reference/#构建适配器)
17+
- [Sessions](/zh-cn/guides/sessions/)

0 commit comments

Comments
 (0)