fix(i18n): update Chinese translation of apis and microservices projects (#38909)

Co-authored-by: S1ngS1ng <liuxing0514@gmail.com>
pull/39610/head
ZhichengChen 2020-09-18 00:11:18 +08:00 committed by GitHub
parent 80438cac3e
commit 27b0af120a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 262 additions and 50 deletions

View File

@ -1,13 +1,18 @@
---
id: 5a8b073d06fa14fcfde687aa
title: Exercise Tracker
localeTitle: 运动追踪器
challengeType: 4
isHidden: false
isRequired: true
forumTopicId: 301505
localeTitle: 运动跟踪器
---
## Description
<section id='description'> 构建一个功能类似于此的完整堆栈JavaScript应用程序 <a href='https://nonstop-pond.glitch.me/' target='_blank'>https://nonstop-pond.glitch.me/</a>。在这个项目上工作将涉及您在我们的入门项目上的Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。使用<a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-exercisetracker/' target='_blank'>此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href='https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/'>此存储库</a>如果您使用Glitch请记住将项目链接保存到安全的地方
<section id='description'>
构建一个功能类似于 <a href='https://fuschia-custard.glitch.me/' target='_blank'>https://fuschia-custard.glitch.me/</a> 的 JavaScript 全栈应用。
在开发这个项目时,我们推荐你在 <a href='https://glitch.com/'>Glitch</a> 上编码。编码完成之后,你可以把应用主页的链接复制到屏幕的输入框中,测试你的代码是否能通过项目需求。当然你也可以基于其他的平台来完成自己的项目,只要提供一个公开的主页便于我们测试就行。
参考示例:你可以通过 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-exercisetracker/'>这个链接</a> 访问在 Glitch 上的项目,或者从 GitHub 上 clone <a href='https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/'>这个仓库的代码</a>。如果你使用 Glitch请记住将项目链接保存到妥当的地方。
</section>
## Instructions
@ -20,16 +25,179 @@ isRequired: true
```yml
tests:
- text: 我可以通过将表单数据用户名发布到 /api/exercise/new-user 来创建用户,并返回将是具有用户名和<code>_id</code>的对象。
testString: ''
- text: 我可以通过使用与创建用户时相同的信息获取 api/exercise/users 来获得所有用户的数组。
testString: ''
- text: '我可以通过将表单数据userId_id描述持续时间和可选日期发布到 /api/exercise/add 来向任何用户添加练习。如果没有提供日期,它将使用当前日期。应用程序将返回添加了练习字段的用户对象。'
testString: ''
- text: 我可以通过使用userId_id参数获取 /api/exercise/log 来检索任何用户的完整练习日志。应用程序将返回添加了数组日志和计数(总运动计数)的用户对象。
testString: ''
- text: '我还可以通过传递from和to或limit的可选参数来检索任何用户的部分日志。日期格式yyyy-mm-ddlimit = int'
testString: ''
- text: 提供独立的项目, 而不是例程 url.
testString: "getUserInput => {
const url = getUserInput('url');
assert(!(new RegExp('.*/fuschia-custard\\.glitch\\.me\\.*')).test(getUserInput('url')));
}
"
- text: 通过指定 `/api/exercise/new-user` 的 username 参数来创建用户, 并且返回一个具有 username 和 _id 的对象。
testString: "async getUserInput => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if (res.ok) {
const { _id, username } = await res.json();
assert.exists(_id);
assert.exists(username);
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
}
"
- text: 通过指定 `api/exercise/users` 的参数为创建用户时相同的信息,来获取到一个用户的数组。
testString: "async getUserInput => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/users');
if (res.ok) {
const data = await res.json();
assert.isArray(data);
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
}
"
- text: 通过指定 `/api/exercise/add` 的 userId、description、duration 和 date可选参数, 去添加一条练习记录。 当没有传入 date 的时候,默认采用当前日期。 应用程序将返回添加了练习字段的用户对象。
testString: "async getUserInput => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if (res.ok) {
const { _id, username } = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: 'Mon Jan 01 1990'
};
const addRes = await fetch(url + '/api/exercise/add', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
if (addRes.ok) {
const actual = await addRes.json();
assert.deepEqual(actual, expected);
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
}
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
}
"
- text: 通过指定 `/api/exercise/log` 的 userId 参数,可以获取任意用户的练习日志和总的练习次数。
testString: "async getUserInput => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if (res.ok) {
const { _id, username } = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + '/api/exercise/add', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}`
});
if (addRes.ok) {
const logRes = await fetch(url + `/api/exercise/log?userId=${_id}`);
if (logRes.ok) {
const { log } = await logRes.json();
assert.isArray(log);
assert.equal(1, log.length);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
} else {
throw new Error(`${addRes.status} ${addRes.statusText}`);
}
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
}
"
- text: 我还可以通过传递可选参数 from & to 或 limit 来检索任何用户的部分日志。(日期格式如: yyyy-mm-dd, limit = int)
testString: "async getUserInput => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
});
if (res.ok) {
const { _id, username } = await res.json();
const expected = {
username,
description: 'test',
duration: 60,
_id,
date: new Date().toDateString()
};
const addExerciseRes = await fetch(url + '/api/exercise/add', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
const addExerciseTwoRes = await fetch(url + '/api/exercise/add', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-02`
});
if (addExerciseRes.ok && addExerciseTwoRes.ok) {
const logRes = await fetch(
url + `/api/exercise/log?userId=${_id}&from=1989-12-31&to=1990-01-03`
);
if (logRes.ok) {
const { log } = await logRes.json();
assert.isArray(log);
assert.equal(2, log.length);
} else {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
const limitRes = await fetch(
url + `/api/exercise/log?userId=${_id}&limit=1`
);
if (limitRes.ok) {
const { log } = await limitRes.json();
assert.isArray(log);
assert.equal(1, log.length);
} else {
throw new Error(`${limitRes.status} ${limitRes.statusText}`);
}
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
} else {
throw new Error(`${res.status} ${res.statusText}`);
}
}
"
```
@ -44,7 +212,11 @@ tests:
<section id='solution'>
```js
// solution required
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```
/section>
</section>

View File

@ -1,13 +1,18 @@
---
id: bd7158d8c443edefaeb5bd0f
title: File Metadata Microservice
localeTitle: 文件元数据微服务
challengeType: 4
isHidden: false
isRequired: true
forumTopicId: 301506
localeTitle: 文件元数据
---
## Description
<section id='description'> 构建一个功能类似于此的完整堆栈JavaScript应用程序: <a href='https://purple-paladin.glitch.me/' target='_blank'>https://purple-paladin.glitch.me/</a> 。 在这个项目上工作将涉及您在我们的入门项目上的Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。 使用<a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-project-filemetadata/' target='_blank'>此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href='https://github.com/freeCodeCamp/boilerplate-project-filemetadata/'>此存储库</a> 如果您使用Glitch请记住将项目链接保存到安全的地方
<section id='description'>
构建一个功能类似于 <a href='https://purple-paladin.glitch.me/' target='_blank'>https://purple-paladin.glitch.me/</a> 的 JavaScript 全栈应用。
在开发这个项目时,我们推荐你在 <a href='https://glitch.com/'>Glitch</a> 上编码。编码完成之后,你可以把应用主页的链接复制到屏幕的输入框中,测试你的代码是否能通过项目需求。当然你也可以基于其他的平台来完成自己的项目,只要提供一个公开的主页便于我们测试就行。
参考示例:你可以通过 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-filemetadata/'>这个链接</a> 访问在 Glitch 上的项目,或者从 GitHub 上 clone <a href='https://github.com/freeCodeCamp/boilerplate-project-filemetadata/'>这个仓库的代码</a>。如果你使用 Glitch请记住将项目链接保存到妥当的地方。
</section>
## Instructions
@ -20,9 +25,9 @@ isRequired: true
```yml
tests:
- text: 我可以提交包含文件上传的FormData对象。
- text: 我可以提交包含文件上传的 FormData 对象。
testString: ''
- text: 当我提交某些内容时我将在JSON响应中收到以字节为单位的文件大小。
- text: 当我提交某些内容时,我将在 JSON 响应中收到以 bytes字节为单位的文件大小。
testString: ''
```
@ -38,7 +43,11 @@ tests:
<section id='solution'>
```js
// solution required
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```
/section>
</section>

View File

@ -1,13 +1,18 @@
---
id: bd7158d8c443edefaeb5bdff
title: Request Header Parser Microservice
localeTitle: 请求Header Parser Microservice
challengeType: 4
isHidden: false
isRequired: true
forumTopicId: 301507
localeTitle: 请求头解析器
---
## Description
<section id='description'> 构建一个功能类似于此的完整堆栈JavaScript应用程序 <a href='https://dandelion-roar.glitch.me/' target='_blank'>https://dandelion-roar.glitch.me/</a> 。 在这个项目上工作将涉及您在我们的入门项目上的Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。 使用<a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-project-headerparser/' target='_blank'>此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href='https://github.com/freeCodeCamp/boilerplate-project-headerparser/'>此存储库</a> 如果您使用Glitch请记住将项目链接保存到安全的地方
<section id='description'>
构建一个功能类似于 <a href='https://dandelion-roar.glitch.me/' target='_blank'>https://dandelion-roar.glitch.me/</a> 的 JavaScript 全栈应用。
在开发这个项目时,我们推荐你在 <a href='https://glitch.com/'>Glitch</a> 上编码。编码完成之后,你可以把应用主页的链接复制到屏幕的输入框中,测试你的代码是否能通过项目需求。当然你也可以基于其他的平台来完成自己的项目,只要提供一个公开的主页便于我们测试就行。
参考示例:你可以通过 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-headerparser/'>这个链接</a> 访问在 Glitch 上的项目,或者从 GitHub 上 clone <a href='https://github.com/freeCodeCamp/boilerplate-project-headerparser/'>这个仓库的代码</a>。如果你使用 Glitch请记住将项目链接保存到妥当的地方。
</section>
## Instructions
@ -20,8 +25,12 @@ isRequired: true
```yml
tests:
- text: “我可以为我的浏览器获取IP地址语言和操作系统。”
testString: ''
- text: 我可以获得浏览器的IP地址、语言和操作系统信息。
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/whoami'').then(data => assert(data.ipaddress && data.ipaddress.length > 0), xhr => { throw new Error(xhr.responseText)})'
- text: '首选语言应该在 <code>language</code> 键里返回。'
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/whoami'').then(data => assert(data.language && data.language.length > 0), xhr => { throw new Error(xhr.responseText)})'
- text: 'software 应该在 <code>software</code> 键里返回。'
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/whoami'').then(data => assert(data.software && data.software.length > 0), xhr => { throw new Error(xhr.responseText)})'
```
@ -36,7 +45,11 @@ tests:
<section id='solution'>
```js
// solution required
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```
/section>
</section>

View File

@ -1,13 +1,18 @@
---
id: bd7158d8c443edefaeb5bdef
title: Timestamp Microservice
localeTitle: 时间戳微服务
challengeType: 4
isHidden: false
isRequired: true
forumTopicId: 301508
localeTitle: 时间戳
---
## Description
<section id='description'> 构建一个功能类似于此的完整堆栈JavaScript应用程序 <a href='https://curse-arrow.glitch.me/' target='_blank'>https://curse-arrow.glitch.me/</a> 。 在这个项目上工作将涉及您在我们的入门项目上的Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。 使用<a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-project-timestamp/' target='_blank'>此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href='https://github.com/freeCodeCamp/boilerplate-project-timestamp/'>此存储库</a> 如果您使用Glitch请记住将项目链接保存到安全的地方
<section id='description'>
构建一个功能类似于 <a href='https://curse-arrow.glitch.me/' target='_blank'>https://curse-arrow.glitch.me/</a> 的 JavaScript 全栈应用。
在开发这个项目时,我们推荐你在 <a href='https://glitch.com/'>Glitch</a> 上编码。编码完成之后,你可以把应用主页的链接复制到屏幕的输入框中,测试你的代码是否能通过项目需求。当然你也可以基于其他的平台来完成自己的项目,只要提供一个公开的主页便于我们测试就行。
参考示例:你可以通过 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-timestamp/'>这个链接</a> 访问在 Glitch 上的项目,或者从 GitHub 上 clone <a href='https://github.com/freeCodeCamp/boilerplate-project-timestamp/'>这个仓库的代码</a>。如果你使用 Glitch请记住将项目链接保存到妥当的地方。
</section>
## Instructions
@ -20,17 +25,17 @@ isRequired: true
```yml
tests:
- text: '它应该处理一个有效的日期并返回正确的unix时间戳'
- text: 当处理一个有效的日期,返回正确的 unix 时间戳。
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/timestamp/2016-12-25'').then(data => { assert.equal(data.unix, 1482624000000, ''Should be a valid unix timestamp''); }, xhr => { throw new Error(xhr.responseText); })'
- text: '它应该处理一个有效的日期并返回正确的UTC字符串'
- text: 当处理一个有效的日期, 返回正确的 UTC 字符串。
testString: 'getUserInput => $.get(getUserInput(''url'')+ ''/api/timestamp/2016-12-25'').then(data => { assert.equal(data.utc, ''Sun, 25 Dec 2016 00:00:00 GMT'', ''Should be a valid UTC date string''); }, xhr => { throw new Error(xhr.responseText); })'
- text: '它应该处理一个有效的unix日期并返回正确的unix时间戳'
- text: 当处理一个有效的 unix 格式的日期, 返回正确的 unix 时间戳。
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/timestamp/1482624000000'').then(data => { assert.equal(data.unix, 1482624000000) ; }, xhr => { throw new Error(xhr.responseText); })'
- text: 它应返回无效日期的预期错误消息
- text: 这个程序应该返回无效日期的预期错误消息
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/timestamp/this-is-not-a-date'').then(data => { assert.equal(data.error.toLowerCase(), ''invalid date'');}, xhr => { throw new Error(xhr.responseText); })'
- text: '它应该处理一个空的日期参数并以unix格式返回当前时间'
- text: 当处理一个空的日期参数的时候,返回当前时间的 unix 格式。
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/timestamp'').then(data => { var now = Date.now(); assert.approximately(data.unix, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })'
- text: '它应该处理一个空日期参数并以UTC格式返回当前时间'
- text: 当处理一个空的日期参数的时候,返回当前时间的 UTC 格式。
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/api/timestamp'').then(data => { var now = Date.now(); var serverTime = (new Date(data.utc)).getTime(); assert.approximately(serverTime, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })'
```
@ -46,7 +51,11 @@ tests:
<section id='solution'>
```js
// solution required
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```
/section>
</section>

View File

@ -1,13 +1,18 @@
---
id: bd7158d8c443edefaeb5bd0e
title: URL Shortener Microservice
localeTitle: URL Shortener微服务
challengeType: 4
isHidden: false
isRequired: true
forumTopicId: 301509
localeTitle: 短网址
---
## Description
<section id='description'>构建一个功能类似于此的完整堆栈JavaScript应用程序 <a href='https://thread-paper.glitch.me/' target='_blank'>https://thread-paper.glitch.me/</a> 。在这个项目上工作将涉及您在我们的入门项目上的Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。使用<a href='https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/freeCodeCamp/boilerplate-project-urlshortener/' target='_blank'>此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href='https://github.com/freeCodeCamp/boilerplate-project-urlshortener/'>此存储库</a> 如果您使用Glitch请记住将项目链接保存到安全的地方
<section id='description'>
构建一个功能类似于 <a href='https://thread-paper.glitch.me/' target='_blank'>https://thread-paper.glitch.me/</a> 的 JavaScript 全栈应用。
在开发这个项目时,我们推荐你在 <a href='https://glitch.com/'>Glitch</a> 上编码。编码完成之后,你可以把应用主页的链接复制到屏幕的输入框中,测试你的代码是否能通过项目需求。当然你也可以基于其他的平台来完成自己的项目,只要提供一个公开的主页便于我们测试就行。
参考示例:你可以通过 <a href='https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-urlshortener/'>这个链接</a> 访问在 Glitch 上的项目,或者从 GitHub 上 clone <a href='https://github.com/freeCodeCamp/boilerplate-project-urlshortener/'>这个仓库的代码</a>。如果你使用 Glitch请记住将项目链接保存到妥当的地方。
</section>
## Instructions
@ -20,11 +25,11 @@ isRequired: true
```yml
tests:
- text: 我可以传递一个URL作为参数我将在JSON响应中收到一个缩短的URL。
- text: 当我传入一个 url 作为参数时我将在JSON响应中收到缩短的URL。
testString: ''
- text: '如果我传递的网址无效并且不遵循有效的http://www.example.com格式则JSON响应将包含错误。'
- text: '如果我传入一个无效的链接,则会返回一个包含 “没有遵循如 http://www.example.com 的有效格式” 的错误信息的 JSON 响应。'
testString: ''
- text: “当我访问缩短的网址时,它会将我重定向到我原来的链接。”
- text: 当我访问这个短 URL 时, 将重定向到我原来的链接。
testString: ''
```
@ -32,7 +37,7 @@ tests:
</section>
## Challenge Seed
<section id='challengeSeed'>
<section id='challengeSeed'
</section>
@ -40,7 +45,11 @@ tests:
<section id='solution'>
```js
// solution required
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```
/section>
</section>