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