Conversation
S1ngS1ng
left a comment
There was a problem hiding this comment.
@sameer1994kiki 内容翻译的很好 👍
<code>两边是不加空格的,任何时候都不加。请参考 style-guide。- 你在每行开头都加了个空格,请把这个空格删掉,否则会影响在页面上 render 的效果
- 所有的
您改成你
个人觉得,这里的 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> 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 存储是应用程序状态的唯一真实来源。", |
| " 在 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> 即可。", |
|
|
||
| " 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>,它里面涵盖了这个内容。" |
There was a problem hiding this comment.
</code> 多了个空格。逗号之后也多了个。
ES6 两边要加空格
后面一句,建议:
你可以参考 <a target=\"_blank\" href=\"http://beta.freecodecamp.com/en/challenges/es6/set-default-parameters-for-your-functions\">ES6 全部课程</a>里面的相关内容。
| { | ||
| "text": "The redux store exists.", | ||
| "testString": "assert(typeof store.getState === 'function', 'The redux store exists.');" | ||
| "text": "redux store 已经存在", |
There was a problem hiding this comment.
已经存在 => 应当存在
这里其实是 (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", |
There was a problem hiding this comment.
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> 的键值类型。", |
| "<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 。", |
There was a problem hiding this comment.
调用 <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> 的操作:", |
| "<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> 的操作:", |
There was a problem hiding this comment.
并且都分发类型 <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> 创建的操作。" |
There was a problem hiding this comment.
代码编辑器中的 Redux store 具有将 <code>login</code> 的属性值设置为 <code>false</code> 的初始化状态对象 =>
代码编辑器中的 Redux store 有将 <code>login</code> 的属性值设置为 <code>false</code> 的初始状态对象
|
@sameer1994kiki 以及,这个 PR 里面的翻译貌似包含了 #34 里面的翻译,麻烦你确认下。如果内容相同,就关掉那个吧 |
dkx translate redux from part2 to part5