chore(i18n,curriculum): update translations (#42684)
This commit is contained in:
@@ -13,7 +13,7 @@ dashedName: use-the-u-tag-to-underline-text
|
||||
|
||||
# --instructions--
|
||||
|
||||
`u` 标签包裹的文本内容应为 `Ph.D. students`。
|
||||
给文本 `Ph.D. students` 添加 `u` 标签。
|
||||
|
||||
**注意:** 如果使用 `u` 标签添加下划线,可能混淆文本和链接,则应避免使用它。 锚标签也有默认的下划线格式。
|
||||
|
||||
@@ -25,7 +25,7 @@ dashedName: use-the-u-tag-to-underline-text
|
||||
assert($('u').length === 1);
|
||||
```
|
||||
|
||||
`u` 标签的文本内容应为 `Ph.D. students`。
|
||||
`u` 标签的内容文本应为 `Ph.D. students`。
|
||||
|
||||
```js
|
||||
assert($('u').text() === 'Ph.D. students');
|
||||
|
@@ -20,7 +20,7 @@ var ourStr = "I come first. ";
|
||||
ourStr += "I come second.";
|
||||
```
|
||||
|
||||
`ourStr` 现在内容为字符串 `I come first. I come second.`
|
||||
`ourStr` 的值为字符串 `I come first. I come second.`
|
||||
|
||||
# --instructions--
|
||||
|
||||
@@ -28,7 +28,7 @@ ourStr += "I come second.";
|
||||
|
||||
# --hints--
|
||||
|
||||
`myStr` 的值应该是 `This is the first sentence. This is the second sentence.`
|
||||
`myStr` 的值应该是字符串 `This is the first sentence. This is the second sentence.`
|
||||
|
||||
```js
|
||||
assert(myStr === 'This is the first sentence. This is the second sentence.');
|
||||
|
@@ -10,7 +10,7 @@ dashedName: use-the-conditional-ternary-operator
|
||||
|
||||
条件运算符( <dfn>conditional operator</dfn>,)(也称为三元运算符( <dfn>ternary operator</dfn>))的就像写成一行的 if-else 表达式
|
||||
|
||||
语法是 `a ? b: c`,其中 `a` 是条件,`b` 是条件返回 `true` 时要运行的代码,`c` 是条件返回 `false` 时要运行的代码。
|
||||
语法是:`a ? b : c`, where `a` 是条件,当条件返回 `true` 的时候运行代码 `b`,当条件返回 `false` 的时候运行代码 `c`。
|
||||
|
||||
以下函数使用 `if/else` 语句来检查条件:
|
||||
|
||||
|
@@ -25,7 +25,7 @@ console.log(greeting());
|
||||
|
||||
# --instructions--
|
||||
|
||||
给函数 `increment` 加上默认参数,使得在 `value` 没有被赋值的时候,默认给 `number` 加上 1。
|
||||
给函数 `increment` 传入默认参数,使得在 `value` 没有被赋值的时候,默认给 `number` 加上 1。
|
||||
|
||||
# --hints--
|
||||
|
||||
|
@@ -37,7 +37,7 @@ console.log(names);
|
||||
|
||||
# --instructions--
|
||||
|
||||
`watchList` 数组保存了包含一些电影信息的对象。 使用 `map` 从 `watchList` 中提取标题(`title`)和评分(`rating`),并将新数组保存在 `ratings` 变量里。 目前编辑器中的代码是使用 `for` 循环实现,使用 `map` 表达式替换循环功能。
|
||||
`watchList` 数组保存了包含一些电影信息的对象。 在 `watchList` 上使用 `map`,将一个新的对象数组赋值给 `ratings` 变量。 新数组中的每个电影都只能有一个值为电影名称的 `title` 键,和一个值为 IMDB 评级的 `rating` 键。 目前编辑器中的代码是使用 `for` 循环实现,你应该使用 `map` 表达式替换循环功能。
|
||||
|
||||
# --hints--
|
||||
|
||||
|
@@ -50,7 +50,7 @@ assert(palindrome('race car') === true);
|
||||
assert(palindrome('not a palindrome') === false);
|
||||
```
|
||||
|
||||
`palindrome("A man, a plan, a canal. Panama")` 应返回 `true`。
|
||||
`palindrome("A man, a plan, a canal. Panama")` 应该返回 `true`。
|
||||
|
||||
```js
|
||||
assert(palindrome('A man, a plan, a canal. Panama') === true);
|
||||
|
@@ -54,7 +54,7 @@ assert(result[0] === 'Aaaaaaaaaaaaaaaa');
|
||||
assert(result[0].length === 16);
|
||||
```
|
||||
|
||||
你的正则表达式不应该有任何匹配,在字符 `He made a fair move. Screaming about it can't help you.`
|
||||
你的正则表达式不应该匹配字符串 `He made a fair move. Screaming about it can't help you.` 中的任何字符。
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -62,7 +62,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
你的正则表达式不应该有任何匹配,在字符 `Let him have it. It's not wise to upset a Wookiee.`
|
||||
你的正则表达式不应该匹配字符串 `Let him have it. It's not wise to upset a Wookiee.` 中的任何字符。
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
@@ -8,7 +8,7 @@ dashedName: render-conditionally-from-props
|
||||
|
||||
# --description--
|
||||
|
||||
到目前为止,已经看到了如何使用 `if/else`、`&&`和三元运算符(`condition ? expressionIfTrue : expressionIfFalse`)对渲染什么和何时渲染做出有条件的判定。 然而,还有一个重要的话题需要讨论,将这些概念中的任何一个或所有概念与另一个强大的 React 功能结合起来:props。 使用 props 有条件地渲染代码在 React 开发人员中很常见 -- 也就是说:他们使用给定 prop 的值来自动决定渲染什么。
|
||||
到目前为止,你已经看到如何使用 `if/else`、`&&` 以及三元运算符(`condition ? expressionIfTrue : expressionIfFalse`)在不同条件下运行不同的代码。 然而,还有一个重要的话题需要讨论,将这些概念中的任何一个或所有概念与另一个强大的 React 功能 props 结合起来。 使用 props 有条件地渲染代码在 React 开发人员中很常见——也就是说:他们使用给定 prop 的值来自动决定渲染什么。
|
||||
|
||||
在这个挑战中,将设置一个子组件来根据 props 做出渲染决定。 可以使用三元运算符,但是可以看到过去几个挑战中涵盖的其他几个概念在这种情况下可能同样有用。
|
||||
|
||||
|
Reference in New Issue
Block a user