Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update translate about #6267 #6286

Merged
merged 21 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/content/docs/zh-cn/guides/integrations-guide/markdoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ i18nReady: true

import FileTree from '~/components/FileTree.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import ReadMore from '~/components/ReadMore.astro';

这个 **[Astro 集成][astro-integration]** 允许使用 [Markdoc](https://markdoc.dev/) 来创建组件、页面和内容集合条目。

Expand Down Expand Up @@ -115,7 +116,7 @@ const { Content } = await entry.render();
<Content />
```

📚 了解更多关于 [Astro 内容集合文档][astro-content-collections] 的信息。
<ReadMore>了解更多关于 [Astro 内容集合文档][astro-content-collections] 的信息。</ReadMore>

## Markdoc 配置

Expand Down Expand Up @@ -252,7 +253,7 @@ export default defineMarkdocConfig({
});
```

📚 要了解如何配置 Prism 样式表,[请看我们的语法高亮指南](/zh-cn/guides/markdown-content/#prism-配置)。
<ReadMore>要了解如何配置 Prism 样式表,[请看我们的语法高亮指南](/zh-cn/guides/markdown-content/#prism-配置)。</ReadMore>

### 设置根 HTML 元素

Expand Down Expand Up @@ -290,7 +291,7 @@ export default defineMarkdocConfig({
});
```

📚 [在他们的文档中找到 Markdoc 的所有内置节点和节点属性。](https://markdoc.dev/docs/nodes#built-in-nodes)
<ReadMore>[在他们的文档中找到 Markdoc 的所有内置节点和节点属性。](https://markdoc.dev/docs/nodes#built-in-nodes)</ReadMore>

### 使用客户端 UI 组件

Expand Down Expand Up @@ -355,7 +356,7 @@ export default defineMarkdocConfig({
¡Hola {% getCountryEmoji("spain") %}!
```

📚 [查看 Markdoc 文档](https://markdoc.dev/docs/functions#creating-a-custom-function) 了解更多关于在你的内容中使用变量或函数的信息。
<ReadMore> [查看 Markdoc 文档](https://markdoc.dev/docs/functions#creating-a-custom-function) 了解更多关于在你的内容中使用变量或函数的信息。</ReadMore>

### Markdoc 语言服务器

Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/zh-cn/guides/integrations-guide/mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ category: other
i18nReady: true
---
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import ReadMore from '~/components/ReadMore.astro'

此 **[Astro 集成][astro-integration]** 能够使用 [MDX](https://mdxjs.com/) 组件,并允许你通过 `.mdx` 文件创建页面。

Expand Down Expand Up @@ -129,7 +130,7 @@ export default defineConfig({
MDX 不支持以字符串形式传递备注和 rehype 插件。你应该安装、导入并应用插件功能来代替。
:::

📚 参见 [Markdown 选项参考](/zh-cn/reference/configuration-reference/#markdown-选项) 以获得完整的选项列表。
<ReadMore>参见 [Markdown 选项参考](/zh-cn/reference/configuration-reference/#markdown-选项) 以获得完整的选项列表。</ReadMore>

### `extendMarkdownConfig`

Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/zh-cn/guides/integrations-guide/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ i18nReady: true
---
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import Since from '~/components/Since.astro';
import ReadMore from '~/components/ReadMore.astro'

此适配器允许 Astro 将你的[`hybrid` 或 `server` 渲染站点](/zh-cn/core-concepts/rendering-modes/#按需渲染) 部署到[Vercel](https://www.vercel.com/)。

Expand Down Expand Up @@ -94,7 +95,7 @@ import vercel from '@astrojs/vercel/static';

## 用法

📚 **[在这里阅读完整的部署指南。](/zh-cn/guides/deploy/vercel/)**
<ReadMore>了解更多关于 [将项目部署到 Vercel](/zh-cn/guides/deploy/vercel/) 的信息。</ReadMore>

你可以通过 CLI ( `vercel deploy` ) 或者通过 [Vercel 控制台](https://vercel.com/) 连接到你的新仓库进行部署。或者,你可以在本地创建生产版本构建:

Expand Down
7 changes: 4 additions & 3 deletions src/content/docs/zh-cn/guides/markdown-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ i18nReady: true

import Since from '~/components/Since.astro'
import FileTree from '~/components/FileTree.astro'
import RecipeLinks from "~/components/RecipeLinks.astro";
import RecipeLinks from "~/components/RecipeLinks.astro"
import ReadMore from '~/components/ReadMore.astro'

[Markdown](https://daringfireball.net/projects/markdown/) 通常用于创作文本繁重的内容,如博客文章和文档。Astro 包括对标准 Markdown 文件的内置支持,这些文件还可以包括 [frontmatter YAML](https://dev.to/paulasantamaria/introduction-to-yaml-125f) 来定义自定义元数据,例如标题、描述和标签。

Expand Down Expand Up @@ -55,7 +56,7 @@ title: Hello, World
- 等等!
```

📚 阅读更多关于 Astro [基于文件的路由](/zh-cn/core-concepts/routing/)或创建[动态路由](/zh-cn/core-concepts/routing/#动态路由)的选项。
<ReadMore>阅读更多关于 Astro [基于文件的路由](/zh-cn/core-concepts/routing/)或创建 [动态路由](/zh-cn/core-concepts/routing/#动态路由) 的选项。</ReadMore>

## Markdown 功能

Expand Down Expand Up @@ -96,7 +97,7 @@ const {frontmatter} = Astro.props;

你也可以在布局组件中[为你的 Markdown 设置样式](/zh-cn/guides/styling/#markdown-样式)。

📚 阅读更多关于 [Markdown 布局](/zh-cn/core-concepts/layouts/#markdownmdx-布局)
<ReadMore>阅读更多关于 [Markdown 布局](/zh-cn/core-concepts/layouts/#markdownmdx-布局) 的内容。</ReadMore>

### 标题 ID

Expand Down
9 changes: 5 additions & 4 deletions src/content/docs/zh-cn/guides/styling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
---
import Since from '~/components/Since.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import ReadMore from '~/components/ReadMore.astro'

Astro 的设计为了使设计和编写 CSS 变得轻而易举。直接在 Astro 组件中编写你自己的 CSS,或者导入你最喜欢的 CSS 库,如 [Tailwind][tailwind] 外。也支持高级样式设计语言,如 [Sass][sass] 和 [Less][less]。

Expand Down Expand Up @@ -103,7 +104,7 @@ const { isRed } = Astro.props;
</style>
```

📚 参见[指令参考](/zh-cn/reference/directives-reference/#classlist)页面,了解更多关于 `class:list` 的信息。
<ReadMore>参见 [指令参考](/zh-cn/reference/directives-reference/#classlist) 页面,了解更多关于 `class:list` 的信息。</ReadMore>

### CSS 变量

Expand All @@ -125,7 +126,7 @@ const backgroundColor = "rgb(24 121 78)";
<h1>Hello</h1>
```

📚 参见[指令参考](/zh-cn/reference/directives-reference/#definevars)页面,了解更多关于 `define:vars` 的信息。
<ReadMore>参见 [指令参考](/zh-cn/reference/directives-reference/#definevars) 页面,了解更多关于 `define:vars` 的信息。</ReadMore>

### 传递 `class` 给子组件

Expand Down Expand Up @@ -173,7 +174,7 @@ import MyComponent from "../components/MyComponent.astro"

有两种使用外部全局样式表的方法:项目源文件中使用 ESM 导入;使用绝对链接引用 `public/` 目录中的文件或托管于别处的文件。

📚 阅读更多关于使用位于 `public/` 或 `src/` 的[静态资源](/zh-cn/guides/imports/)
<ReadMore>阅读更多关于使用位于 `public/` 或 `src/` 的 [静态资源](/zh-cn/guides/imports/) 的内容。</ReadMore>

### 导入本地样式表

Expand Down Expand Up @@ -447,7 +448,7 @@ Astro 支持在项目中添加流行的 CSS 库、工具和框架,如 [Tailwin
</Fragment>
</PackageManagerTabs>

📚 参见[集成指南](/zh-cn/guides/integrations-guide/),了解安装、导入和配置这些集成的说明。
<ReadMore>参见 [集成指南](/zh-cn/guides/integrations-guide/),了解安装、导入和配置这些集成的说明。</ReadMore>

## CSS 预处理器

Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/zh-cn/guides/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ const { title } = Astro.props;
`astro check` 会检查你 TypeScript 项目中的所有文件。要检查 Svelte 和 Vue 文件中的类型,可以使用 [`svelte-check`](https://www.npmjs.com/package/svelte-check) 和 [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) 包。
:::

📚 阅读更多关于 Astro 中的 [`.ts` 文件导入](/zh-cn/guides/imports/#typescript)。
import ReadMore from '~/components/ReadMore.astro'

📚 阅读更多关于 [TypeScript 配置](https://www.typescriptlang.org/tsconfig/)。
<ReadMore>阅读更多关于 Astro 中的 [`.ts` 文件导入](/zh-cn/guides/imports/#typescript) 的内容。</ReadMore>

<ReadMore>阅读更多关于 [TypeScript 配置](https://www.typescriptlang.org/tsconfig/) 的内容。</ReadMore>

## 故障排除

Expand Down
24 changes: 19 additions & 5 deletions src/content/docs/zh-cn/install/auto.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,22 @@ Astro 将实时监听 `src/` 目录中的文件更改,因此你在开发过程

以下是我们建议接下来探索的几个主题。 你可以按任何顺序阅读它们。 你甚至可以暂时离开我们的文档,然后去玩你的新 Astro 项目代码库,遇到麻烦或有疑问时返回这里。

📚 **添加框架**:在我们的[集成指南](/zh-cn/guides/integrations-guide/)中学习如何使用 `npx astro add` 扩展 Astro 以支持 React、Svelte、Tailwind 等。

📚 **部署你的网站**:在我们的[部署指南](/zh-cn/guides/deploy/)中了解如何构建 Astro 项目并将其部署到网络。

📚 **了解你的代码库**:在我们的[项目结构指南](/zh-cn/core-concepts/project-structure/)中了解更多关于 Astro 项目结构的信息。
import { CardGrid, LinkCard } from '@astrojs/starlight/components';

<CardGrid>
<LinkCard
title="了解你的代码库"
description="在我们的项目结构指南中了解更多关于 Astro 项目结构的信息。"
href="/zh-cn/core-concepts/project-structure/"
/>
<LinkCard
title="添加框架"
description="在我们集成指南中学习如何扩展 Astro 以支持 React、Svelte、Tailwind 等。"
href="/zh-cn/guides/integrations-guide/"
/>
<LinkCard
title="部署你的网站"
description="在我们的部署指南中了解如何构建 Astro 项目并将其部署到网络。"
href="/zh-cn/guides/deploy/"
/>
</CardGrid>
5 changes: 3 additions & 2 deletions src/content/docs/zh-cn/install/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: 如何通过 NPM、PNPM 或 Yarn 来手动安装 Astro。
import Button from '~/components/Button.astro'
import FileTree from '~/components/FileTree.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import ReadMore from '~/components/ReadMore.astro'

如果你不想使用[自动化 CLI 工具](/zh-cn/install/auto/),本指南将引导你完成手动安装和配置新 Astro 项目的步骤。

Expand Down Expand Up @@ -148,7 +149,7 @@ export default defineConfig({});
如果你想集成像 React、Svelte 这样的[UI 框架组件](/zh-cn/core-concepts/framework-components/)或是使用其他类似 Tailwind 或 Partytown 这样的工具,你可以在[手动导入并配置集成](/zh-cn/guides/integrations-guide/)章节内获取更多信息。


📚 阅 读Astro 的[API配置参考](/zh-cn/reference/configuration-reference/)章节可以获得更多内容。
<ReadMore>阅读 Astro 的 [API 配置参考](/zh-cn/reference/configuration-reference/) 章节来获得更多内容。</ReadMore>

## 6. 添加 TypeScript 支持

Expand All @@ -170,7 +171,7 @@ TypeScript 使用`tsconfig.json`进行配置。即使你不编写 TypeScript 代
/// <reference types="astro/client" />
```

📚 阅读 Astro 的 [TypeScript 设置指南](/zh-cn/guides/typescript/#设置)以获取更多信息。
<ReadMore> 阅读 Astro 的 [TypeScript 设置指南](/zh-cn/guides/typescript/#设置) 来获取更多信息。</ReadMore>

## 7. 接下来

Expand Down
12 changes: 7 additions & 5 deletions src/content/docs/zh-cn/recipes/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type: recipe
i18nReady: true
---
import FileTree from '~/components/FileTree.astro'
import ReadMore from '~/components/ReadMore.astro'
import StaticSsrTabs from '~/components/tabs/StaticSsrTabs.astro'

在这个指南中,你将学习如何使用内容集合和动态路由来构建你自己的国际化(i18n)解决方案,并针对不同的语言提供你的内容。
Expand Down Expand Up @@ -95,7 +96,7 @@ import StaticSsrTabs from '~/components/tabs/StaticSsrTabs.astro'
};

```
📚 你可以在这获取有关更多 [内容集合](/zh-cn/guides/content-collections/) 的内容。
<ReadMore>你可以在这获取有关更多 [内容集合](/zh-cn/guides/content-collections/) 的内容。</ReadMore>

3. 使用 [动态路由](/zh-cn/core-concepts/routing/#动态路由) 来获取并基于 `lang` 和 `slug` 参数的内容渲染内容。

Expand Down Expand Up @@ -156,7 +157,7 @@ import StaticSsrTabs from '~/components/tabs/StaticSsrTabs.astro'
</Fragment>
</StaticSsrTabs>

📚 你可以在这获取有关更多 [动态路由](/zh-cn/core-concepts/routing/#动态路由) 的内容。
<ReadMore>你可以在这获取有关更多 [动态路由](/zh-cn/core-concepts/routing/#动态路由) 的内容。</ReadMore>


:::tip[日期格式化]
Expand Down Expand Up @@ -501,6 +502,7 @@ import StaticSsrTabs from '~/components/tabs/StaticSsrTabs.astro'
- [Right-to-left Styling 101](https://rtlstyling.com/)

## 其他第三方库
- [astro-i18next](https://github.com/yassinedoghri/astro-i18next) — An Astro integration for i18next including some utility components.
- [astro-i18n](https://github.com/alexandre-fernandez/astro-i18n) — A TypeScript-first internationalization library for Astro.
- [astro-i18n-aut](https://github.com/jlarmstrongiv/astro-i18n-aut) — An Astro integration for i18n that supports the `defaultLocale` without page generation. The integration is adapter agnostic and UI framework agnostic.
- [astro-i18next](https://github.com/yassinedoghri/astro-i18next) — 为 i18next 提供的 Astro 集成,包括一些实用组件。
- [astro-i18n](https://github.com/alexandre-fernandez/astro-i18n) — 为 Astro 设计的以 TypeScript 为主的国际化库。
- [astro-i18n-aut](https://github.com/jlarmstrongiv/astro-i18n-aut) — i18n 的 Astro 集成,无需生成页面即可支持`defaultLocale`。该集成与适配器、UI 框架无关。
- [paraglide](https://inlang.com/c/astro) — 一个专门为像 Astro 群岛这样的部分水合模式设计的完全类型安全的 i18n 库。
6 changes: 3 additions & 3 deletions src/content/docs/zh-cn/reference/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: API 参考
---
import Since from '~/components/Since.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

import ReadMore from '~/components/ReadMore.astro';

## `Astro` global

Expand Down Expand Up @@ -130,9 +130,9 @@ import Heading from '../components/Heading.astro';
<Heading title="我的第一篇文章" date="09 Aug 2022" />
```

📚 进一步了解 [Markdown 和 MDX 布局](/zh-cn/guides/markdown-content/#frontmatter-layout)如何处理 props
<ReadMore>进一步了解关于 [Markdown 和 MDX 布局](/zh-cn/guides/markdown-content/#frontmatter-layout) 如何处理 props 的内容。</ReadMore>

📚 了解如何为你的 props 添加 [TypeScript 类型定义](/zh-cn/guides/typescript/#组件参数)
<ReadMore>了解如何为你的 props 添加 [TypeScript 类型定义](/zh-cn/guides/typescript/#组件参数) 的内容。</ReadMore>



Expand Down
3 changes: 2 additions & 1 deletion src/content/docs/zh-cn/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: CLI 命令

import Since from '~/components/Since.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import ReadMore from '~/components/ReadMore.astro'

你可以使用 Astro 提供的命令行界面 (CLI) 从终端窗口开发、构建和预览你的项目。

Expand Down Expand Up @@ -173,7 +174,7 @@ Global Flags

该命令将监听你项目中的任何更改,并报告任何错误。

📚 阅读更多关于 [在 Astro 中类型检查](/zh-cn/guides/typescript/) 的信息。
<ReadMore>阅读更多关于 [在 Astro 中类型检查](/zh-cn/guides/typescript/) 的信息。</ReadMore>

## `astro sync`

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/zh-cn/reference/directives-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: 模板指令参考
---

import Since from '~/components/Since.astro';
import ReadMore from '~/components/ReadMore.astro'

**模板指令**是特殊的 HTML 属性,它可以在任一 Astro 组件模板(`.astro` 文件)中使用,也可以在 `.mdx` 文件中使用。

Expand Down Expand Up @@ -208,7 +209,7 @@ import api from '../db/api.js';

你可以在组件中同时使用 `<style>` 和 `<style is:global>`,创建一些全局样式规则,同时仍对大部分组件 CSS 进行作用域控制。

📚 有关全局样式工作的更多细节,请参见[样式 & CSS](/zh-cn/guides/styling/#全局样式)页面。
<ReadMore>有关全局样式工作的更多细节,请参见 [样式 & CSS](/zh-cn/guides/styling/#全局样式) 页面。</ReadMore>

```astro
<style is:global>
Expand Down Expand Up @@ -248,7 +249,7 @@ import api from '../db/api.js';
</script>
```

📚 查看[客户端脚本](/zh-cn/guides/client-side-scripts/)如何在 Astro 组件中工作。
<ReadMore>查看 [客户端脚本](/zh-cn/guides/client-side-scripts/) 如何在 Astro 组件中工作。</ReadMore>

### `define:vars`

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/zh-cn/tutorials/add-view-transitions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import MultipleChoice from '~/components/tutorial/MultipleChoice.astro';
import Option from '~/components/tutorial/Option.astro';
import Spoiler from '~/components/Spoiler.astro';
import PreCheck from '~/components/tutorial/PreCheck.astro';

import ReadMore from '~/components/ReadMore.astro'


**视图过渡动画**是一种用来控制访问者在网站页面之间导航时页面内容变化方式的方法。Astro 的 View Transitions API 允许开发者添加可选的导航特性。有了这个特性,你可以方便地为你的网站实现平滑页面切换和页面切换动画;控制浏览器访问页面的历史记录;或者阻止浏览器重新加载整个页面,以使部分元素在切换页面时保持原有状态而不是完全刷新。
Expand Down Expand Up @@ -380,7 +380,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro';
```
在浏览器预览中导航到任何博客文章,你会发现描述淡入的速度比其他文本慢。

📚了解更多关于不同的[过渡指令](/zh-cn/guides/view-transitions/#过渡动画指令)[自定义动画](/zh-cn/guides/view-transitions/#自定义动画)的信息。
<ReadMore>了解更多关于不同的 [过渡指令](/zh-cn/guides/view-transitions/#过渡动画指令)[自定义动画](/zh-cn/guides/view-transitions/#自定义动画) 的信息。</ReadMore>

### 为某些链接设置强制浏览器重新加载页面

Expand Down
Loading