-
-
Notifications
You must be signed in to change notification settings - Fork 523
Add Chinese Doc #329
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
Add Chinese Doc #329
Conversation
|
@ydfzgyj Thanks for your contribution! 👍 |
|
@Akryum Already updated~ 😄 |
|
Awesome! @sodatea would you review the translation? |
|
😄My pleasure |
docs/zh-cn/README.md
Outdated
| - title: 自动更新 | ||
| details: 无需考虑更新 UI 或重新获取查询的问题! | ||
| - title: 模板内组件 | ||
| details: 通过真正声明 Apollo 组件的方式使用 Apollo |
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.
这句话有点不通顺。"in a declarative way" 应当是「声明式地使用」
docs/zh-cn/guide/installation.md
Outdated
|
|
||
| ## Apollo Boost | ||
|
|
||
| Apollo Boost 是一种零配置开始使用 Apollo Client 的方式。它包含一些合理的默认值,例如我们推荐的 `InMemoryCache` 和 `HttpLink`,它非常适合用于快速启动开发: |
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.
sensible 在这里的意思可能更接近于「实用的」
docs/zh-cn/guide/apollo/README.md
Outdated
|
|
||
| ## 查询(Queries) | ||
|
|
||
| 为每个你需要通过 Apollo 查询提供数据的属性,在 `apollo` 对象中添加一个特性。 |
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.
这里 property 和 attribute 应该不需要区分,都翻译成「属性」比较好(考虑到后面代码里的注释也都是这么翻译的)。如果实在需要区分,个人觉得「字段」比「特性」更常用。
「Apollo 查询」漏翻了 result。
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.
这里 property 和 attribute 应该不需要区分,都翻译成「属性」比较好(考虑到后面代码里的注释也都是这么翻译的)。如果实在需要区分,个人觉得「字段」比「特性」更常用。
“为属性添加属性”这种写法看起来太奇怪了……我是参考了 Vue 文档的翻译,把 attribute 改成“特性”了
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.
但是其他地方 attribute 都是翻译成属性……感觉有点不一致。而且 Vue 里面的特性更多指的是模板中的特性,这个概念跟 HTML 特性一致,但不适合形容对象属性。
可以试着加个定语?为 Vue 属性在 apollo 对象里添加对应属性?如果还是觉得不通顺的话这里不改也不要紧。
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.
好的,加一个定语应该更好理解
docs/zh-cn/guide/apollo/queries.md
Outdated
| @@ -0,0 +1,401 @@ | |||
| # 查询 | |||
|
|
|||
| 为每个你需要通过 Apollo 查询提供数据的属性,在 `apollo` 对象中添加一个特性。每一个特性都将创建一个智能查询。 | |||
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.
同 docs/zh-cn/guide/apollo/README.md 中的评论。
docs/zh-cn/guide/apollo/README.md
Outdated
| const apolloProvider = new VueApollo({ | ||
| defaultClient: apolloClient, | ||
| defaultOptions: { | ||
| // apollo 选项将应用于组件中的所有查询 |
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.
「将应用于组件中的所有查询的 apollo 选项」
docs/zh-cn/guide/apollo/mutations.md
Outdated
| 想要了解更多信息,请访问 [apollo 文档](https://www.apollographql.com/docs/react/api/apollo-client.html#ApolloClient.mutate)。有一个以变更为重点的 [示例应用](https://github.com/Akryum/vue-apollo-todos),你可以看看。 | ||
|
|
||
| ::: warning | ||
| 你不应当在变量中发送 `__typename` 字段,因此不建议直接发送 Apollo 结果对象。 |
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.
不应当发送变量中的 __typename 字段
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.
不应当发送变量中的 __typename 字段
这里是指在使用 this.$apollo.mutate 时,其中传递给 variables 这个属性的值不能包含 __typename,如果改成“变量中的 __typename 字段”意思就不对了
如果有歧义的话,我把“变量”改成“变量属性”如何?
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.
这里是说 the variables 而不是 variables,应该说的是变量里不应该带 __typename 属性,也就是说,其他 apollo 查询拿到的结果(因为结果里会带 __typename)不能直接拿来当做参数。
当然按你的理解也不影响使用,但这样的话 variables 就应该保留原文了。
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.
我还是倾向于这里的 variables 和下边是对应的,那么我改成原文吧
- fix some words in completed pages
docs/zh-cn/guide/testing.md
Outdated
| expect(wrapper.element).toMatchSnapshot(); | ||
| }); | ||
| ``` | ||
| 对于简单的变更测试,你需要检查组件中是否调用了 `$apollo` 的方法 `mutate`。接下来的示例在 `addHero` 方法中调用了变更: |
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.
$apollo 的 mutate 方法
docs/zh-cn/guide/testing.md
Outdated
| expect(wrapper.element).toMatchSnapshot(); | ||
| }); | ||
| ``` | ||
| 在这个用例中,所有字符串字段将等于 `Hello World` 且所有数值都将为负数。如果你想要获得更多实际的响应,则应当为某些查询指定解析器: |
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.
「更多实际的响应」->「更贴近实际的响应」
|
抱歉之前时间有限没有 review 完整。 |
close #318
Hope somebody will review my translation