chore(i8n,learn): processed chinese translations (#40716)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
github-actions[bot]
2021-01-20 18:58:05 -08:00
committed by GitHub
parent 8d8d25e9f2
commit 7bd905f393
7 changed files with 32 additions and 28 deletions

View File

@ -9,7 +9,7 @@ dashedName: add-a-submit-button-to-a-form
# --description--
让我们来给表单添加一个 `submit`(提交)按钮。点击提交按钮时,表单中的数据将会被发送到 `action` 属性指定的 URL 上。
让我们来给表单添加一个 `submit`(提交)按钮。 点击提交按钮时,表单中的数据将会被发送到 `action` 属性指定的 URL 上。
例如:
@ -17,11 +17,11 @@ dashedName: add-a-submit-button-to-a-form
# --instructions--
请在表单(`form` 元素)底部创建一个 `button` 元素,将按钮的 `type` 属性值设置为 `submit`,内容文本为 `提交`
请在表单(`form` 元素)底部添加一个按钮,将按钮的 type 属性值设置为 `submit`,内容文本为“提交”
# --hints--
表单内部应有一个 `button` 元素
表单内部应有一个按钮
```js
assert($('form').children('button').length > 0);

View File

@ -17,15 +17,15 @@ dashedName: add-images-to-your-website
注意:`img` 元素是没有结束标签的。
所有的 `img` 元素**必须**有 `alt` 属性。`alt` 的属性值有两个作用,第一个作用是让屏幕阅读器可以知晓图片的内容,这会对网页的可访问性有很大提升;另一个作用是当图片无法加载时,页面需要显示的替代文本。
所有的 `img` 元素**必须**有 `alt` 属性。 `alt` 的属性值有两个作用,第一个作用是让屏幕阅读器可以知晓图片的内容,这会对网页的可访问性有很大提升;另一个作用是当图片无法加载时,页面需要显示的替代文本。
注意:如果图片是纯装饰性的,把 `alt` 的属性值设置为空是最佳实践。
**注意:**如果图片是纯装饰性的,把 `alt` 的属性值设置为空是最佳实践。
理想情况下,`alt` 属性不应该包含特殊字符,除非有特殊需要。
让我们给上面例子的 `img` 添加 `alt` 属性。
`<img src="https://www.freecatphotoapp.com/your-image.jpg" alt="一只打着领带的商务猫">`
`<img src="https://www.freecatphotoapp.com/your-image.jpg" alt="A business cat wearing a necktie.">`
# --instructions--
@ -33,11 +33,11 @@ dashedName: add-images-to-your-website
`main` 元素里,给 `p` 元素前面插入一个 `img` 元素。
然后将 `src` 的属性值设置为这个 URL
然后将 `src` 的属性值设置为这个 url
`https://bit.ly/fcc-relaxing-cat`
最后,不要忘记给图片加上 `alt` 属性。
最后,不要忘记给 `img` 加上 `alt` 属性。
# --hints--
@ -47,19 +47,21 @@ dashedName: add-images-to-your-website
assert($('img').length);
```
`img` 应该有一个 `src` 属性,其值为猫咪图片的 URL
你的图片应该有一个 `src` 属性,其值为猫咪图片的 url
```js
assert(/^https:\/\/bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src')));
```
`img` 元素的 `alt` 属性值不应为空。
你的图片元素的 `alt` 属性值不应为空。
```js
assert(
$('img').attr('alt') &&
$('img').attr('alt').length &&
/<img\S*alt=(['"])(?!\1|>)\S+\1\S*\/?>/.test(code.replace(/\s/g, ''))
/<img\S*alt=(['"])(?!\1|>)\S+\1\S*\/?>/.test(
__helpers.removeWhiteSpace(code)
)
);
```

View File

@ -9,7 +9,7 @@ dashedName: add-placeholder-text-to-a-text-field
# --description--
`Placeholder` 占位符用户在 `input` 输入框中输入任何东西前的预定义文本。
占位符文本用户在 `input` 输入框中输入任何东西前的预定义文本。
你可以像这样创建一个占位符:
@ -29,7 +29,7 @@ dashedName: add-placeholder-text-to-a-text-field
assert($('input[placeholder]').length > 0);
```
设置 `placeholder` 属性的值为 `cat photo URL`
设置占位符属性的值为 `cat photo URL`
```js
assert(

View File

@ -9,23 +9,25 @@ dashedName: check-radio-buttons-and-checkboxes-by-default
# --description--
如果想设置某个单选按钮或多选按钮默认被选中,只需给 `input` 元素添加 "checked" 属性。 例如:
`checked` 属性把第一个复选框和单选按钮都设置为默认选中
要实现以上要求,只需给 input 元素添加 "checked" 属性。 例如:
`<input type="radio" name="test-name" checked>`
# --instructions--
把第一个 `radio button` 和第一个 `checkbox` 都设置为默认选中。
把第一个单选按钮和第一个复选框都设置为默认选中。
# --hints--
表单的第一个选按钮应被默认选中。
表单的第一个选按钮应被默认选中。
```js
assert($('input[type="radio"]').prop('checked'));
```
表单的第一个多选按钮应被默认选中。
表单的第一个复选框应被默认选中。
```js
assert($('input[type="checkbox"]').prop('checked'));

View File

@ -15,7 +15,7 @@ dashedName: comment-out-html
# --instructions--
任务:注释掉 `h1` 元素和 `p` 元素,保留 `h2` 元素。
注释掉 `h1` 元素和 `p` 元素,保留 `h2` 元素。
# --hints--

View File

@ -11,7 +11,7 @@ dashedName: create-a-bulleted-unordered-list
HTML 有一个特定的元素用于创建<dfn>无序列表</dfn>
无序列表以 `<ul>` 开始,中间包含一个或多个 `<li>` 元素,最后以 `</ul>` 结束。
无序列表以 `<ul>` 开始,中间包含一个或多个 `<li>` 元素, 最后以 `</ul>` 结束。
例如:

View File

@ -11,19 +11,19 @@ dashedName: link-to-external-pages-with-anchor-elements
你可以用 `a`Anchor简写为 a来实现网页间的跳转。
`a` 需要一个 `href` 属性指向跳转的目的地同时,它还应有内容例如:
`a` 需要一个 `href` 属性指向跳转的目的地同时,它还应有内容例如:
`<a href="https://freecodecamp.org">链接到 freeCodeCamp</a>`
在浏览器中,以上的标签会将文字 **"链接到 freeCodeCamp"** 展示成一个可点击的超链接。点击该文本就会跳转到 `https://freecodecamp.org`
在浏览器中,以上的标签会将文字 **"链接到 freeCodeCamp"** 展示成一个可点击的超链接。 点击该文本就会跳转到 **`https://freecodecamp.org`**
# --instructions--
创建一个内容文本为 `cat photos``a` 元素,并将其 `href` 属性值设置为 `https://freecatphotoapp.com`
创建一个内容文本为 cat photos`a` 元素,并将其 `href` 属性值设置为 `https://freecatphotoapp.com`
# --hints--
`a` 元素的内容文本应为`cat photos`
`a` 元素的文本应为cat photos
```js
assert(/cat photos/gi.test($('a').text()));
@ -32,7 +32,7 @@ assert(/cat photos/gi.test($('a').text()));
你的 `a` 元素应链接到 `https://freecatphotoapp.com`
```js
assert(/http:\/\/(www\.)?freecatphotoapp\.com/gi.test($('a').attr('href')));
assert(/https:\/\/(www\.)?freecatphotoapp\.com/gi.test($('a').attr('href')));
```
确保 `a` 元素有结束标签。