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

Dkx redux2to5 #44

Open
wants to merge 3 commits into
base: translate
Choose a base branch
from

Conversation

sameer1994kiki
Copy link

dkx translate redux from part2 to part5

Copy link
Contributor

@S1ngS1ng S1ngS1ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sameer1994kiki 内容翻译的很好 👍

  1. <code> 两边是不加空格的,任何时候都不加。请参考 style-guide。
  2. 你在每行开头都加了个空格,请把这个空格删掉,否则会影响在页面上 render 的效果
  3. 所有的 改成

个人觉得,这里的 action 可能保留,不去翻译会比较好,总感觉翻译成 操作 有点奇怪。可以在第一次出现的时候用括号注明翻译,但其他部分,我感觉还是保留比较好。= = 你觉得呢?

@huluoyang @wudifeixue 你们的意见?

"Declare a <code>store</code> variable and assign it to the <code>createStore()</code> method, passing in the <code>reducer</code> as an argument.",
"<strong>Note:</strong>&nbsp;The code in the editor uses ES6 default argument syntax to initialize this state to hold a value of <code>5</code>. If you're not familiar with default arguments, you can refer to the <a target=\"_blank\" href=\"http://beta.freecodecamp.com/en/challenges/es6/set-default-parameters-for-your-functions\">ES6 section in the Beta Curriculum</a> which covers this topic."
" Redux 是一个状态管理框架,可以与包括 React 在内的许多不同的 Web 技术一起使用。",
" 在 Redux 中,有一个状态对象负责应用程序的整个状态, 这意味着如果你有一个包含十个组件且每个组件都有自己的本地状态的 React 项目,那么这个项目的整个状态将通过 Redux <code>store</code> 被定义为单个状态对象, 这是学习 Redux 时要理解的第一个重要原则:Redux 存储是应用程序状态的唯一真实来源。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉逗号之后多余的空格。

" 在 Redux 中,有一个状态对象负责应用程序的整个状态, 这意味着如果你有一个包含十个组件且每个组件都有自己的本地状态的 React 项目,那么这个项目的整个状态将通过 Redux <code>store</code> 被定义为单个状态对象, 这是学习 Redux 时要理解的第一个重要原则:Redux 存储是应用程序状态的唯一真实来源。",
" 这也意味着,如果你的应用程序想要更新状态,只能通过 Redux store 执行,单向数据流可以更轻松地对应用程序中的状态进行监测管理。",

" Redux <code>store</code> 是一个保存和管理应用程序状态的 <code>state</code>,你可以使用Redux对象中的 <code>createStore()</code> 来创建一个 redux <code>store</code>,此方法将 <code>reducer</code> 函数作为必需参数,<code>reducer</code> 函数将在后面的挑战中介绍,该函数已在代码编辑器中为您定义,它只需将 <code>state</code> 作为参数并返回一个 <code>state</code> 即可。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把英文逗号换成中文的


" Redux <code>store</code> 是一个保存和管理应用程序状态的 <code>state</code>,你可以使用Redux对象中的 <code>createStore()</code> 来创建一个 redux <code>store</code>,此方法将 <code>reducer</code> 函数作为必需参数,<code>reducer</code> 函数将在后面的挑战中介绍,该函数已在代码编辑器中为您定义,它只需将 <code>state</code> 作为参数并返回一个 <code>state</code> 即可。",
" 声明一个 <code>store</code> 变量并把它分配给 <code>createStore()</code> 方法,然后把 <code>reducer</code> 作为一个参数传入即可。",
" 注意: 编辑器中的代码使用ES6默认参数语法初始化 state 以保存 <code>5</ code> 的值, 如果你不熟悉默认参数,你可以参考<a target=\"_blank\" href=\"http://beta.freecodecamp.com/en/challenges/es6/set-default-parameters-for-your-functions\">ES6全部课程</a>,它里面涵盖了这个内容。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</code> 多了个空格。逗号之后也多了个。


ES6 两边要加空格


后面一句,建议:
你可以参考 <a target=\"_blank\" href=\"http://beta.freecodecamp.com/en/challenges/es6/set-default-parameters-for-your-functions\">ES6 全部课程</a>里面的相关内容。

@@ -47,16 +47,16 @@
},
"tests": [
{
"text": "The redux store exists.",
"testString": "assert(typeof store.getState === 'function', 'The redux store exists.');"
"text": "redux store 已经存在",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经存在 => 应当存在

这里其实是 (Assert that) the redux store exists.。下同

},
{
"text": "The redux store has a value of 5 for the state.",
"testString": "assert(store.getState()=== 5, 'The redux store has a value of 5 for the state.');"
"text": "redux store 的 state 的值为 5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state 的值为 5 => state 的值应为 5。

注意结尾的句号。下同

},
{
"text": "The returned action should have a key property type with value <code>LOGIN</code>.",
"testString": "assert(action.type === 'LOGIN', 'The returned action should have a key property type with value <code>LOGIN</code>.');"
"text": " 返回的操作应具有值为 <code>LOGIN</code> 的键值类型。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

"<blockquote>store.dispatch(actionCreator());<br>store.dispatch({ type: 'LOGIN' });</blockquote>",
"<hr>",
"The Redux store in the code editor has an initialized state that's an object containing a <code>login</code> property currently set to <code>false</code>. There's also an action creator called <code>loginAction()</code> which returns an action of type <code>LOGIN</code>. Dispatch the <code>LOGIN</code> action to the Redux store by calling the <code>dispatch</code> method, and pass in the action created by <code>loginAction()</code>."
" <code>dispatch</code> 方法用于将操作分派给 Redux store,调用 <code>store.dispatch()</code> 并将从操作创建者返回的值发送回 store 。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调用 <code>store.dispatch()</code> 并将从操作创建者返回的值发送回 store 。 =>

调用<code>store.dispatch()</code>并传入从操作创建者返回的值,这样就可以把 action 发送回 store 了。

"<hr>",
"The Redux store in the code editor has an initialized state that's an object containing a <code>login</code> property currently set to <code>false</code>. There's also an action creator called <code>loginAction()</code> which returns an action of type <code>LOGIN</code>. Dispatch the <code>LOGIN</code> action to the Redux store by calling the <code>dispatch</code> method, and pass in the action created by <code>loginAction()</code>."
" <code>dispatch</code> 方法用于将操作分派给 Redux store,调用 <code>store.dispatch()</code> 并将从操作创建者返回的值发送回 store 。",
" 动作创建者返回一个具有 type 属性的对象,该属性指定已发生的动作,然后,该方法将操作对象分发到 Redux store ,根据之前的挑战示例,以下内容是等效的,并且都分发类型 <code>LOGIN</code> 的操作:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第一句话,建议同上

"<hr>",
"The Redux store in the code editor has an initialized state that's an object containing a <code>login</code> property currently set to <code>false</code>. There's also an action creator called <code>loginAction()</code> which returns an action of type <code>LOGIN</code>. Dispatch the <code>LOGIN</code> action to the Redux store by calling the <code>dispatch</code> method, and pass in the action created by <code>loginAction()</code>."
" <code>dispatch</code> 方法用于将操作分派给 Redux store,调用 <code>store.dispatch()</code> 并将从操作创建者返回的值发送回 store 。",
" 动作创建者返回一个具有 type 属性的对象,该属性指定已发生的动作,然后,该方法将操作对象分发到 Redux store ,根据之前的挑战示例,以下内容是等效的,并且都分发类型 <code>LOGIN</code> 的操作:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

并且都分发类型 <code>LOGIN</code> 的操作: =>
并且都分发类型为 <code>LOGIN</code> 的操作:

" 动作创建者返回一个具有 type 属性的对象,该属性指定已发生的动作,然后,该方法将操作对象分发到 Redux store ,根据之前的挑战示例,以下内容是等效的,并且都分发类型 <code>LOGIN</code> 的操作:",
" <blockquote>store.dispatch(actionCreator());<br>store.dispatch({ type: 'LOGIN' });</blockquote>",

" 代码编辑器中的 Redux store 具有将 <code>login</code> 的属性值设置为 <code>false</code> 的初始化状态对象,还有一个名为 <code>loginAction()</code> 的动作创建器,它返回类型为 <code>LOGIN</code> 的动作,然后通过调用 <code>dispatch</code> 方法将 <code>LOGIN</code> 操作分发给 Redux store,并传递 <code>loginAction()</code> 创建的操作。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码编辑器中的 Redux store 具有将 <code>login</code> 的属性值设置为 <code>false</code> 的初始化状态对象 =>
代码编辑器中的 Redux store 有将 <code>login</code> 的属性值设置为 <code>false</code> 的初始状态对象

@S1ngS1ng S1ngS1ng added the need update Use when a translation (?) PR has been reviewed and needs to address comments label Jul 31, 2018
@S1ngS1ng
Copy link
Contributor

@sameer1994kiki 以及,这个 PR 里面的翻译貌似包含了 #34 里面的翻译,麻烦你确认下。如果内容相同,就关掉那个吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need update Use when a translation (?) PR has been reviewed and needs to address comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants