Skip to content

Commit

Permalink
i18n(zh-cn): Update astro-i18n.mdx (#10830)
Browse files Browse the repository at this point in the history
Co-authored-by: Armand Philippot <[email protected]>
  • Loading branch information
Nin3lee and ArmandPhilippot authored Feb 5, 2025
1 parent 2509b02 commit 94ac4b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/zh-cn/reference/modules/astro-i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ getRelativeLocaleUrl("fr");
// 返回 /fr
getRelativeLocaleUrl("fr", "");
// 返回 /fr
// 返回 /fr/
getRelativeLocaleUrl("fr", "getting-started");
// 返回 /fr/getting-started
Expand All @@ -84,7 +84,7 @@ getRelativeLocaleUrl("fr_CA", "getting-started", {

<p>

**类型:**`(locale: string, path: string, options?: GetLocaleOptions) => string`
**类型:**`(locale: string, path?: string, options?: GetLocaleOptions) => string`
</p>

[`site`] 配置了值时,使用这个函数来检索一个语言环境的绝对路径。如果 [`site`] 没有被配置,该函数将返回一个相对 URL。如果语言环境不存在,Astro 会抛出一个错误。
Expand All @@ -100,7 +100,7 @@ getAbsoluteLocaleUrl("fr");
// 返回 https://example.com/fr
getAbsoluteLocaleUrl("fr", "");
// 返回 https://example.com/fr
// 返回 https://example.com/fr/
getAbsoluteLocaleUrl("fr", "getting-started");
// 返回 https://example.com/fr/getting-started
Expand Down

0 comments on commit 94ac4b9

Please sign in to comment.