-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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): Translated astro-syntax.mdx #2982
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks @allenli178! FYI, this page is marked as |
These pages are now ready for translation, thanks for the patience! |
|
||
### 定义集合模式 | ||
|
||
模式在集合中强制执行一致的front-matter。模式**保证**当你需要引用或查询它时,你的 frontmatter 以可预测的形式存在。如果任何文件违反了它的集合模式,Astro 将提供一个有用的错误让你知道。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a missing space between the Chinese and English text.
|
||
当使用动态标签时: | ||
|
||
- **变量名必须大**。例如,使用 `Element`,而不是 `element`。否则,Astro 将尝试把变量名渲染为文本 HTML 标签。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
变量名必须大 -> 变量名首字母必须大写?
|
||
- **不支持 hydration 指令**。当使用[`client:*` hydration 指令时](/zh-cn/core-concepts/framework-components/#激活组件),Astro 需要知道哪些组件要捆绑到生产环境中,而动态标签模式阻止了这一点。 | ||
|
||
### 片段及多元素 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some content is outdated. See commit: 6b6f629
@allenli178 你好,我们正在组织社区译者来进行 Astro 中文文档的翻译,你是否愿意继续推动这个 PR 的进行呢?如果你因为其他原因不能推进,我们愿意接手过来。期待你的回复。 |
有时间的,也希望可以为社区做点贡献。
…---Original---
From: ***@***.***>
Date: Fri, Jul 28, 2023 16:40 PM
To: ***@***.***>;
Cc: "YuYan ***@***.******@***.***>;
Subject: Re: [withastro/docs] i18n(zh-cn): Translated astro-syntax.mdx (PR#2982)
@allenli178 你好,我们正在组织社区译者来进行 Astro 中文文档的翻译,你是否愿意继续推动这个 PR 的进行呢?如果你因为其他原因不能推进,我们愿意接手过来。期待你的回复。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@Yan-Thomas Can you make the CI run the |
} | ||
--- | ||
<!-- ❌ 这样行不通 ❌ --> | ||
<button onClick={handleClick}>Nothing will happen when you click me!</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<button onClick={handleClick}>Nothing will happen when you click me!</button> | |
<button onClick={handleClick}>当你点击我的时候什么都不会发生!</button> |
There may be a need for translation here as well.
|
||
```astro title="src/components/RootElements.astro" | ||
--- | ||
// Template with multiple elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Template with multiple elements | |
// 包含多个元素的模板 |
--- | ||
// Template with multiple elements | ||
--- | ||
<p>No need to wrap elements in a single containing element.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>No need to wrap elements in a single containing element.</p> | |
<p>无需将元素包装在单个包含元素中。</p> |
// Template with multiple elements | ||
--- | ||
<p>No need to wrap elements in a single containing element.</p> | ||
<p>Astro supports multiple root elements in a template.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>Astro supports multiple root elements in a template.</p> | |
<p>Astro 支持模板中的多个根元素。</p> |
@allenli178 内容集合页面,自从创建这个 PR 以来,有了很多提交,你可以更新一下吗。 另外,这两个页面翻译完成后,其他页面会有大量的 broken link(等待 @Yan-Thomas 运行 CI check link)。希望你也可以在这个 PR 中修复他们。 |
好的 周末有空我会更新一下的 |
有一些跨文件的链接。 以 为例。我要怎么写这样的链接。我试了 |
|
||
## 查询集合 | ||
|
||
Astro 提供了两个函数来查询一个集合并返回一个(或多个)内容条目: [`getCollection()`](/zh-cn/reference/api-reference/#`getCollection()`)和 [`getEntry()`](/zh-cn/reference/api-reference/#`getEntry()`)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Astro 提供了两个函数来查询一个集合并返回一个(或多个)内容条目: [`getCollection()`](/zh-cn/reference/api-reference/#`getCollection()`)和 [`getEntry()`](/zh-cn/reference/api-reference/#`getEntry()`)。 | |
Astro 提供了两个函数来查询一个集合并返回一个(或多个)内容条目: [`getCollection()`](/zh-cn/reference/api-reference/#getcollection)和 [`getEntry()`](/zh-cn/reference/api-reference/#getentry)。 |
应该是这样,可以在原页面点击右侧目录看一下
|
||
3. 创建至少一个集合(`src/content/` 的文件夹中) ,并将 Markdown 和 MDX 页面从 `src/pages/` 移动到 `src/content/` 的这些子目录中。当同一集合中的所有文件具有相似的 fronmatter 属性时,集合的工作效果最好。因此,请选择新的文件夹结构以反映类似类型的页面。 | ||
|
||
例如,要迁移[教程中的博客文章](/en/tutorial/2-pages/2/) ,请将 `src/pages/post/` 的内容移动到 `src/content/posts/`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
例如,要迁移[教程中的博客文章](/en/tutorial/2-pages/2/) ,请将 `src/pages/post/` 的内容移动到 `src/content/posts/`。 | |
例如,要迁移[教程中的博客文章](/zh-cn/tutorial/2-pages/2/) ,请将 `src/pages/post/` 的内容移动到 `src/content/posts/`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tutorial还没有中文翻译
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
会 fallback 到英文
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
如果你的编辑器不能识别 `Astro:content`,请确保使用的是最新版本的 Astro,并尝试重新启动开发服务器。 | ||
::: | ||
|
||
5. [从集合中生成路由](#从集合中生成路由)。在集合中,Markdown 和 MDX 文件不再使用 Astro 的[基于文件的路由](/zh-cn/guides/markdown-content/#基于文件的路由)自动成为页面,因此必须自己生成页面。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5. [从集合中生成路由](#从集合中生成路由)。在集合中,Markdown 和 MDX 文件不再使用 Astro 的[基于文件的路由](/zh-cn/guides/markdown-content/#基于文件的路由)自动成为页面,因此必须自己生成页面。 | |
5. [从集合中生成路由](#从内容生成路由)。在集合中,Markdown 和 MDX 文件不再使用 Astro 的[基于文件的路由](/zh-cn/guides/markdown-content/#基于文件的路由)自动成为页面,因此必须自己生成页面。 |
Should be #从内容生成路由
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>
内容大体上可以了。但是其他页面应该有链接会挂掉,不知道为啥 check link 的 CI 没运行。 |
Runned the CI, there's well, lots of broken links! Could you fix them? After doing so I believe we're good to go! |
Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>
@allenli178 一有新的 commit 提交,CI 就重新运行了。你可以在本地全局搜索一下其他页面,有引用到这两个页面的链接的,锚点部分要改成对应中文 |
ok, 我一会儿有空的时候弄一下。 |
@liruifengv @Yan-Thomas |
这里有一个最新的修改 878f1bd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks peeps 🚀
No description provided.