Skip to content

Conversation

@CatcherO
Copy link
Contributor

@CatcherO CatcherO commented Jul 25, 2018

翻译章节

《算法和数据结构——调试》

变更文件

  • debugging.json

  • debugging.md

翻译进度

  • 100%

  • 100%

CatcherO and others added 2 commits July 25, 2018 16:36
…na#11)

* Translation of intermediate-algorithm-scripting, first half

* Address comments
@S1ngS1ng S1ngS1ng added the ready for review Use when a translation (?) PR is ready for review label Jul 26, 2018
S1ngS1ng and others added 15 commits July 26, 2018 17:59
* Add CONTRIBUTING.md, add guide of git

* address review comments

- Pick pull --rebase among three options
- Update guideline of resolving conflicts

* Add git FAQ. Remove labels def as for not needed

* Fix style issue, using HTML tags

* Update Details w/ GFM, fix wrong command

* Update FAQ with guide of resolving conflicts and clarification of git add . vs git add -A

* Update CONTRIBUTING.md

更新了下排版

* Update CONTRIBUTING.md

更改符号的使用

* Update CONTRIBUTING.md

continue fix some type error
Add a pattern that captures .vscode.*\.json, as provided by FreeCodeCampChina#7
* fix some typo error

* remove upcoming fileds

* resolve conflicts
Fix inline code in summary title that is not rendering
* translation 2/10

* translation 4/10

* translate assert & revise

* translation 2/10

* revise

* fix typo

* translation 2/10

* fix typo

* revise

* translate the document

* fix typo

* translate the title

* remove upcoming
* part1

* update previous & 2/5 finished

* space fix

* fix part1&part2 spacing
* 完成helmet第一小节翻译

* Finish 10%

* Remove IDE generated files

* Update according to comments
* finish 50% translation of object-oriented-programming

* modify translate

* change 对象 to  物体 in the real life.
* add: 完成BasicCSS的前4个教程。

* alter: 修改调整翻译中文。

* add: 继续翻译3小节。

* fixed: 修复语义,以及翻译格式。

* update: 替换空格&修改css class翻译。

* remove extra whitespace
* 01-responsive-web-design\css-grid.json is completed

* translatre Update 2018/7/23-11:00

* translate Updata 2018/7/23-11:10

* css-grid-cn.json updata no.2

* Del '-cn' files

* 'css-grid.json' Updata no.3

* css-grid.json updata no.4

* 'css-grid.md' Updata no.1

* css-grid.md updata no.2, .h空间’ changed to '间距'

* css-grid.json Updata change some punctuations

* 01-responsive-web-design\css-grid.json is completed

* translatre Update 2018/7/23-11:00

* translate Updata 2018/7/23-11:10

* css-grid-cn.json updata no.2

* Del '-cn' files

* css-grid.json updata no.4

* css-grid.json Updata change some punctuations

* css-grid.md updata 2018/7/27 22:13
* Update style guide, fixing format issue, adding anchor link in CONTRIBUTING.md and adding content

* Add em-dash style guide

* Add two more rules
* translation 2/10

* translation 4/10

* translate assert & revise

* translation 2/10

* revise

* fix typo

* 01-responsive-web-design/css-flexbox.json 翻译完成

* translation 2/10

* fix typo

* revise

* css-flexbox.md 翻译完成

标题等待统一翻译

* translate the document

* fix typo

* translate the title

* 根据建议修改翻译
…reeCodeCampChina#41)

* Add instruction of new PR based off current branch and explanation of rebase workflow

* Fix typo
@huluoyang
Copy link
Contributor

整体翻译很不错,稍微调整下语序就完美了,另外请记得翻译 debugging.md。

{
"text": "Your code should fix the comparison operator in the terminal condition of the loop.",
"testString": "assert(!code.match(/i\\s*?!=\\s*?4;/g), 'Your code should fix the comparison operator in the terminal condition of the loop.');"
"text": "你的代码应该在循环的终止条件中修复比较运算符。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your code => 你
此处应全局替换

Your code should fix the comparison operator in the terminal condition of the loop.
你应该修改比较运算符来避免出现死循环。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩,太“翻译腔”了 😂

@huluoyang huluoyang added need update Use when a translation (?) PR has been reviewed and needs to address comments and removed ready for review Use when a translation (?) PR is ready for review labels Aug 1, 2018
Copy link
Contributor

@S1ngS1ng S1ngS1ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一点点格式的问题。内容 OK 的 👍

"You can find Developer tools in your Chrome's menu or Web Console in FireFox's menu. If you're using a different browser, or a mobile phone, we strongly recommend switching to desktop Firefox or Chrome.",
"The <code>console.log()</code> method, which \"prints\" the output of what's within its parentheses to the console, will likely be the most helpful debugging tool. Placing it at strategic points in your code can show you the intermediate values of variables. It's good practice to have an idea of what the output should be before looking at what it is. Having check points to see the status of your calculations throughout your code will help narrow down where the problem is.",
"Here's an example to print 'Hello world!' to the console:",
"Chrome Firefox 都有出色的 JavaScript 控制台,也称为 DevTools,用于调试你的 JavaScript 代码。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议:
Chrome 和 Firefox 都有出色的 JavaScript 控制台(也称为 DevTools),可以用来调试你的 JavaScript 代码。

"The <code>console.log()</code> method, which \"prints\" the output of what's within its parentheses to the console, will likely be the most helpful debugging tool. Placing it at strategic points in your code can show you the intermediate values of variables. It's good practice to have an idea of what the output should be before looking at what it is. Having check points to see the status of your calculations throughout your code will help narrow down where the problem is.",
"Here's an example to print 'Hello world!' to the console:",
"Chrome Firefox 都有出色的 JavaScript 控制台,也称为 DevTools,用于调试你的 JavaScript 代码。",
"你可以在 Chrome 的菜单中找到“开发者工具”或 FireFox 的菜单中的“ Web 控制台”。如果你使用其他浏览器或手机,我们强烈建议你切换到桌面版 Firefox Chrome",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

个人觉得 Web 前面的空格应该加到引号外面。Web 后面的空格你加的没错

现在:
image

建议:
image

"Here's an example to print 'Hello world!' to the console:",
"Chrome Firefox 都有出色的 JavaScript 控制台,也称为 DevTools,用于调试你的 JavaScript 代码。",
"你可以在 Chrome 的菜单中找到“开发者工具”或 FireFox 的菜单中的“ Web 控制台”。如果你使用其他浏览器或手机,我们强烈建议你切换到桌面版 Firefox Chrome",
"<code>console.log()</code>方法可能是最有用的调试工具,它可以将括号中的内容输出到控制台,将它放在代码中的关键点可以显示变量的中间值。在查看输出之前,最好先了解输出应该是什么。在整个代码中使用检查点来查看计算状态将有助于缩小问题所在。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

变量的中间值 => 变量在当时的值

我感觉这个 intermediate 指的是执行过程中。你来决定怎么翻译好吧


在查看输出之前,最好先了解输出应该是什么。 =>
在查看输出之前,最好先想清楚输出应该是什么。

"Chrome Firefox 都有出色的 JavaScript 控制台,也称为 DevTools,用于调试你的 JavaScript 代码。",
"你可以在 Chrome 的菜单中找到“开发者工具”或 FireFox 的菜单中的“ Web 控制台”。如果你使用其他浏览器或手机,我们强烈建议你切换到桌面版 Firefox Chrome",
"<code>console.log()</code>方法可能是最有用的调试工具,它可以将括号中的内容输出到控制台,将它放在代码中的关键点可以显示变量的中间值。在查看输出之前,最好先了解输出应该是什么。在整个代码中使用检查点来查看计算状态将有助于缩小问题所在。",
"下面是输出 'Hello world!' 到控制台的示例:",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个叹号是不该用全角的,这是个 string

"Values passed to <code>console.log()</code> in the text editor block run each set of tests as well as one more time for any function calls that you have in you code.",
"This lends itself to some interesting behavior and might trip you up in the beginning, because a logged value that you expect to see only once may print out many more times depending on the number of tests and the values being passed to those tests.",
"If you would like to see only your single output and not have to worry about running through the test cycles, you can use <code>console.clear()</code>.",
"你可能已经注意到一些 freeCodeCamp JavaScript 的挑战有他们自己的控制台。这些控制台的行为与你在上一次挑战中使用的浏览器控制台略有不同。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议去掉 他们

"As covered in previous challenges, the assignment operator (<code>=</code>) in JavaScript assigns a value to a variable name. And the <code>==</code> and <code>===</code> operators check for equality (the triple <code>===</code> tests for strict equality, meaning both value and type are the same).",
"The code below assigns <code>x</code> to be 2, which evaluates as <code>true</code>. Almost every value on its own in JavaScript evaluates to <code>true</code>, except what are known as the \"falsy\" values: <code>false</code>, <code>0</code>, <code>\"\"</code> (an empty string), <code>NaN</code>, <code>undefined</code>, and <code>null</code>.",
"<blockquote>let x = 1;<br>let y = 2;<br>if (x = y) {<br>&nbsp;&nbsp;// this code block will run for any value of y (unless y were originally set as a falsy)<br>} else {<br>&nbsp;&nbsp;// this code block is what should run (but won't) in this example<br>}</blockquote>",
"分支程序,即在满足某些条件时执行不同操作的程序,依赖于 JavaScript中的<code>if</code><code>else if</code><code>else</code>语句。条件有时采取测试一个结果是否等于一个值的形式。",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript 之后加上空格

列举的时候,逗号应该改成顿号,去掉

"<code>Off by one errors</code> (sometimes called OBOE) crop up when you're trying to target a specific index of a string or array (to slice or access a segment), or when looping over the indices of them. JavaScript indexing starts at zero, not one, which means the last index is always one less than the length of the item. If you try to access an index equal to the length, the program may throw an \"index out of range\" reference error or print <code>undefined</code>.",
"When you use string or array methods that take index ranges as arguments, it helps to read the documentation and understand if they are inclusive (the item at the given index is part of what's returned) or not. Here are some examples of off by one errors:",
"<blockquote>let alphabet = \"abcdefghijklmnopqrstuvwxyz\";<br>let len = alphabet.length;<br>for (let i = 0; i <= len; i++) {<br>&nbsp;&nbsp;// loops one too many times at the end<br>&nbsp;&nbsp;console.log(alphabet[i]);<br>}<br>for (let j = 1; j < len; j++) {<br>&nbsp;&nbsp;// loops one too few times and misses the first character at index 0<br>&nbsp;&nbsp;console.log(alphabet[j]);<br>}<br>for (let k = 0; k < len; k++) {<br>&nbsp;&nbsp;// Goldilocks approves - this is just right<br>&nbsp;&nbsp;console.log(alphabet[k]);<br>}</blockquote>",
"当你试图访问字符串或数组的特定索引(分割或访问一个片段)或循环索引时,有时会出现<code>Off by one errors</code>错误(有时称为 OBOE)。 JavaScript 索引从<code>0</code>开始,而不是<code>1</code>,这意味着最后一个索引总会比字符串或数组的长度少 1。 如果你尝试访问等于长度的索引,程序可能会抛出“索引超出范围”引用错误或打印出<code>undefined</code>",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

句号之后多了个空格,两处

"使用<code>console.log()</code>在每个循环中打印变量值可以发现与重置相关的错误行为,或者重置变量失败。",
"<hr>",
"The following function is supposed to create a two-dimensional array with <code>m</code> rows and <code>n</code> columns of zeroes. Unfortunately, it's not producing the expected output because the <code>row</code> variable isn't being reinitialized (set back to an empty array) in the outer loop. Fix the code so it returns a correct 3x2 array of zeroes, which looks like <code>[[0, 0], [0, 0], [0, 0]]</code>."
"以下函数应该创建一个具有<code>m</code>行和<code>n</code>列“零”的二维数组。不幸的是,它没有产生预期的输出,因为<code>row</code>变量没有在外部循环中重新初始化(设置回空数组)。修改代码,使其正确地返回包含 3 行 2 列“零”的二维数组,即<code>[[0,0],[0,0],[0,0]]</code>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code 里面的逗号应该保持英文的(否则这段代码就有问题了),不应该用全角。以及,后面要加空格。
用原文的就好

"程序员的工作是确保最终达到终止条件,该条件告诉程序何时跳出循环。有一种错误是从终端条件向错误方向递增或递减计数器变量。另一种是在循环代码中意外重置计数器或索引变量,而不是递增或递减它。",
"<hr>",
"The <code>myFunc()</code> function contains an infinite loop because the terminal condition <code>i != 4</code> will never evaluate to <code>false</code> (and break the looping) - <code>i</code> will increment by 2 each pass, and jump right over 4 since <code>i</code> is odd to start. Fix the comparison operator in the terminal condition so the loop only runs for <code>i</code> less than or equal to 4."
"<code>myFunc()</code>函数包含一个无限循环,因为终止条件<code>i != 4</code>永远不会为<code>false</code>(并中断循环) -<code>i</code>将每次递增2,然后跳过4,因为<code>i</code>是从奇数开始递增。在终端条件中输入比较运算符,使循环仅在<code>i</code>小于或等于4的情况下运行。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

数字要加空格(逗号前的不用加)。参考 style-guide
递增 2,然后跳过 4,
小于或等于 4 的情况

XERO75 and others added 4 commits August 3, 2018 05:09
* part1

* update previous & 2/5 finished

* space fix

* fix part1&part2 spacing

* fix conflicts

* merge

* translate part4

* finished part5

* translate md

* corret

* translate ajax_md

* just fix some type error

* Update responsive-web-design-projects.md

* Update responsive-web-design-projects.json

* fix some typo error
Copy link
Contributor

@S1ngS1ng S1ngS1ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@S1ngS1ng S1ngS1ng added the :shipit: ship it Use when a translation (?) PR is ready for shipping label Aug 3, 2018
@S1ngS1ng S1ngS1ng removed the need update Use when a translation (?) PR has been reviewed and needs to address comments label Aug 3, 2018
```

Debugging is frustrating, but it helps to develop (and follow) a step-by-step approach to review your code. This means checking the intermediate values and types of variables to see if they are what they should be. You can start with a simple process of elimination.
调试会让人抓狂,但它有助于开发(并遵循)逐步审查代码的方法。检查变量在程序运行过程中的值和类型是否正确。你可以从一个简单的消除过程开始。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句不知道怎么翻才好 🤒 ...

Copy link
Contributor

@huluoyang huluoyang Aug 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CatcherO 是有点不好翻译,我尝试了下,你看看如何:
调试本身总是令人沮丧的,但它有助于让你学会一种逐步检查代码的方法。这意味着你要去检查中间值和变量类型,看看它们是否是你所期望的。在这过程中,运用排除法,你很快就能找到问题的所在。

@S1ngS1ng S1ngS1ng self-assigned this Aug 5, 2018
@S1ngS1ng S1ngS1ng added need update Use when a translation (?) PR has been reviewed and needs to address comments and removed :shipit: ship it Use when a translation (?) PR is ready for shipping labels Aug 5, 2018
@S1ngS1ng
Copy link
Contributor

S1ngS1ng commented Aug 5, 2018

@CatcherO 内容上没问题了。不过你的 commit history 乱了 😂
参考一下 https://github.com/FreeCodeCampChina/challenges/blob/translate/CONTRIBUTING.md#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98 的最后一个问题。记得不要混用 git pullgit pull --rebase
如果解决不了,微信加我私聊

@S1ngS1ng
Copy link
Contributor

S1ngS1ng commented Aug 6, 2018

Changes addressed in #60

@S1ngS1ng S1ngS1ng closed this Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need update Use when a translation (?) PR has been reviewed and needs to address comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.