Skip to content

Translate managing-packages-with-npm #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 28, 2018

Conversation

ifyour
Copy link
Contributor

@ifyour ifyour commented Jul 19, 2018

翻译章节

《API 和 微服务——NPM》

变更文件

  • managing-packages-with-npm.json
  • managing-packages-with-npm.md

翻译进度

  • 100%
  • 100%

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.

@huluoyang

  1. 建议调整一下 wiki 中文件的顺序。那些注明了“实战”的,先翻译可能会更好。
  2. 我觉得,testString 字段也是要翻译的,但不是翻译全部,只需要翻译 assert(first, second) 中,第二个参数 second 就行,因为这个是控制台输出。
    详情参考 我在 curriculum-cn 里的这条评论

@ifyour 里面提到的大部分是建议,你来决定改不改吧,但格式、上下文统一的问题,还是建议你改下


Update: assert typo fix 🤦‍♂️

"One of the most common pieces of information in this file is the author-field that specifies who’s the creator of a project. It can either be a string or an object with contact details. The object is recommended for bigger projects but in our case, a simple string like the following example will do.",
"package.json 是任何 Node.js 项目或 NPM 包的中心。它存储项目的相关信息,就像 HTML 文档中的 <head>-section 描述网页内容一样。 package.json 由单个 JSON 对象组成,它以键值对的形式存储项目的信息。 一个最小的 package.json 文件至少包含两个必须字段:name 和 version -- 但是提供有关项目的附加信息是一个更好的做法,在以后它可能对你的用户或者维护者有所帮助。",
"author 字段",
"如果你转到之前设置的 Glitch 项目并查看屏幕左侧,你会找到看到一个文件树,你可以在其中查看项目中各种文件的概述。 在文件树的末尾部分,你会看到 package.json - 我们将在接下来的几个挑战中改进这个文件。",
Copy link
Contributor

Choose a reason for hiding this comment

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

注意,这里的 Glitch 不是项目名字,而是一个平台:https://glitch.com/
请参考 这里,或点击 这个页面 中 "Go to the first lesson" 上一行的 "this link"

@huluoyang 参考 Review 评论的建议


你会找到看到一个文件树 =>
你会看到一个文件树


……你可以在其中查看项目中各种文件的概述。 在文件树的末尾部分……

请删除全角句号之后的空格。下同

Copy link
Contributor Author

Choose a reason for hiding this comment

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

只需要翻译 aseert(first, second) 中

这里有一处拼写错误

aseert => assert

🤓

Copy link
Contributor

Choose a reason for hiding this comment

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

@ifyour 谢谢。找了半天才找到你说的部分 😂
应该到外面评论的,这里是 code diff 的 comment。如果在 review 之后,你 commit 了相关行代码的改动,这里就会默认折叠 🌝

"If you go to the Glitch project that you set up previously and look at on the left side of your screen, you’ll find the file tree where you can see an overview of the various files in your project. Under the file tree’s back-end section, you’ll find package.json - the file that we’ll be improving in the next couple of challenges.",
"One of the most common pieces of information in this file is the author-field that specifies who’s the creator of a project. It can either be a string or an object with contact details. The object is recommended for bigger projects but in our case, a simple string like the following example will do.",
"package.json 是任何 Node.js 项目或 NPM 包的中心。它存储项目的相关信息,就像 HTML 文档中的 <head>-section 描述网页内容一样。 package.json 由单个 JSON 对象组成,它以键值对的形式存储项目的信息。 一个最小的 package.json 文件至少包含两个必须字段:name 和 version -- 但是提供有关项目的附加信息是一个更好的做法,在以后它可能对你的用户或者维护者有所帮助。",
"author 字段",
Copy link
Contributor

Choose a reason for hiding this comment

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

尽管原文没有,但个人觉得最后加个冒号可能会更好,下同。你来决定吧

"The author-field",
"If you go to the Glitch project that you set up previously and look at on the left side of your screen, you’ll find the file tree where you can see an overview of the various files in your project. Under the file tree’s back-end section, you’ll find package.json - the file that we’ll be improving in the next couple of challenges.",
"One of the most common pieces of information in this file is the author-field that specifies who’s the creator of a project. It can either be a string or an object with contact details. The object is recommended for bigger projects but in our case, a simple string like the following example will do.",
"package.json 是任何 Node.js 项目或 NPM 包的中心。它存储项目的相关信息,就像 HTML 文档中的 <head>-section 描述网页内容一样。 package.json 由单个 JSON 对象组成,它以键值对的形式存储项目的信息。 一个最小的 package.json 文件至少包含两个必须字段:name 和 version -- 但是提供有关项目的附加信息是一个更好的做法,在以后它可能对你的用户或者维护者有所帮助。",
Copy link
Contributor

Choose a reason for hiding this comment

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

原文:just like the <head>-section in a HTML document describes the content of a webpage
建议翻译:就像 HTML 文档中的 <head> 区域是用来描述网页的通用信息(元信息)一样

参考:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/head
另外,讲道理,说 “<head> 是用来描述网页内容” 有些不准确,<body> 才是吧。


……它以键值对的形式存储项目的信息。 一个最小的 package.json ……

全角句号之后不需要再加空格了。参考规范第四条


version 之后,如果你需要使用破折号,应该是 ,macos 上可以用 shift + option + - 打出。请参考这个截图,
image
破折号应该是 em dash,而不是两个 en dash。你采用的是两个 en dash。详情参考 wikipedia 破折号

Copy link
Contributor

@huluoyang huluoyang Jul 20, 2018

Choose a reason for hiding this comment

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

我也是看了 wikipedia 才知道原来中文破折号来自于英文破折号:em dash。
en dash 也就是我们常用的连接符,这确实是2个完全不同的符号,感谢@S1ngS1ng

Copy link
Contributor Author

Choose a reason for hiding this comment

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

学习了

"package.json 是任何 Node.js 项目或 NPM 包的中心。它存储项目的相关信息,就像 HTML 文档中的 <head>-section 描述网页内容一样。 package.json 由单个 JSON 对象组成,它以键值对的形式存储项目的信息。 一个最小的 package.json 文件至少包含两个必须字段:name version -- 但是提供有关项目的附加信息是一个更好的做法,在以后它可能对你的用户或者维护者有所帮助。",
"author 字段",
"如果你转到之前设置的 Glitch 项目并查看屏幕左侧,你会找到看到一个文件树,你可以在其中查看项目中各种文件的概述。 在文件树的末尾部分,你会看到 package.json - 我们将在接下来的几个挑战中改进这个文件。",
"这个文件中最常见的信息之一是作者字段,它指定了谁是项目的创建者。它可以是字符串,也可以是带有联系人详细信息的对象。对于较大的项目,建议使用对象,但是在我们的例子中,一个简单的字符串就可以了,比如下面的例子。",
Copy link
Contributor

Choose a reason for hiding this comment

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

作者字段 建议改成 author 字段,或 作者(author)字段

请尽量保持统一,比如你在后文就采用了 author 字段 这样的表达方式

"All field-names must use double-quotes (\"), e.g. \"author\"",
"All fields must be separated with a comma (,)"
"说明",
"将你的名字添加到 Glitch 项目的 package.json 中的 author 字段中。",
Copy link
Contributor

Choose a reason for hiding this comment

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

将你的名字添加到 Glitch 项目的 package.json 中的 author 字段中。
可以改成:
将你的名字添加到 Glitch 项目中,package.json 的 author 字段。

"Instructions",
"Add an array of suitable strings to the keywords-field in the package.json of your Glitch project.",
"One of the keywords should be freecodecamp."
"正如你所见,这个字段的结构是一个包含双引号字符串的数组。",
Copy link
Contributor

Choose a reason for hiding this comment

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

包含双引号字符串的数组 建议改成:
由双引号字符串组成的数组

"Some common licenses for open source projects include MIT and BSD. http://choosealicense.com is a great resource if you want to learn more about what license could fit your project.",
"License information is not required. Copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do.",
"Example",
"license 字段是你告知用户你的项目允许用在什么地方。",
Copy link
Contributor

@S1ngS1ng S1ngS1ng Jul 19, 2018

Choose a reason for hiding this comment

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

原文 The license-field is where you inform users of your project what they are allowed to do with it.
这是一个复杂句,整体上是一个 where 引导的表语从句(predictive clause)里面嵌套了一个 what 引导的宾语从句。
注意理清每个部分之间的关系,以及 theyit 的指代。最后的 it 指代的是项目(project),they 指代的是用户,因此这里要表达的是:告知用户,(让他们知道)他们可以如何使用这个项目(what to do),而不是告知他们用在什么地方(where to use)

因此这里应该翻译成:
license 字段是你告知用户应该如何使用项目的地方。

Copy link
Contributor

@huluoyang huluoyang Jul 20, 2018

Choose a reason for hiding this comment

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

作为一个英文小白,当我看到这么详细的分析时,真的是热泪盈眶,我的英文老师也这样多好。
@S1ngS1ng 的分析大体是对的,但有一处有误。
如何使用和(what to do)并不符合,如何使用应该对应(how to use)
把这句话一分为二:
The license-field is where you inform users of your project.
license 字段是你告知你的项目使用者的地方。(告知什么内容呢?后面会细说)
what they are allowed to do with it.
允许他们拿这个项目干什么?
合二为一:
license 字段是你告知你的项目使用者允许他们拿这个项目干什么的地方。
简化如下:
项目使用者=>用户
你的=>省略(废话,不是我的项目会是谁的项目)
总结:
license 字段是你告知用户允许他们拿这个项目干什么的地方。

Copy link
Contributor

Choose a reason for hiding this comment

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

@huluoyang 嗯嗯,是这个意思! 😂 确实,上面我写的不够标准。。

"License information is not required. Copyright laws in most countries will give you ownership of what you create by default. However, it’s always a good practice to explicitly state what users can and can’t do.",
"Example",
"license 字段是你告知用户你的项目允许用在什么地方。",
"开源项目的一些常用许可证包括 MIT 和 BSD。如果你想了解更多适合你项目的许可证的信息,那么 http://choosealicense.com 是一个不错的网站。",
Copy link
Contributor

Choose a reason for hiding this comment

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

习惯上,不说“开源许可证”,而应该是“开源许可”、“开源协议”。下同。

参考 wikipedia 上的 许可
image

这里建议调整一下语序,变成:常见的开源协议是 MIT 和 BSD。

"Example",
"license 字段是你告知用户你的项目允许用在什么地方。",
"开源项目的一些常用许可证包括 MIT 和 BSD。如果你想了解更多适合你项目的许可证的信息,那么 http://choosealicense.com 是一个不错的网站。",
"许可证信息并不是必须的。大多数国家的版权法会默认让你拥有自己创作的作品的所有权。 但是,明确说明用户可以做什么和不能做什么始终是一个很好的做法。",
Copy link
Contributor

Choose a reason for hiding this comment

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

始终是 建议改成 一直都是 或者 会是

@@ -127,23 +127,23 @@
"id": "587d7fb4367417b2b2512c00",
"title": "Expand Your Project with External Packages from npm",
"description": [
"One of the biggest reasons to use a package manager is their powerful dependency management. Instead of manually having to make sure that you get all dependencies whenever you set up a project on a new computer, npm automatically installs everything for you. But how can npm know exactly what your project needs? Meet the dependencies-section of your package.json.",
"In the dependencies-section, packages your project require are stored using the following format:",
"使用包管理器的最大原因之一是它们强大的依赖管理特性。在新的计算机上开始一个项目时,不用手动确认你已安装所有的依赖,npm 会自动为你安装它们。但是 npm 如何准确的知道你项目需要哪些依赖呢? 我们来看看 package.json 中 dependencies 这一部分。",
Copy link
Contributor

Choose a reason for hiding this comment

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

请删去全角问号之后的空格

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.

LGTM 👍

@S1ngS1ng S1ngS1ng added the ready for review Use when a translation (?) PR is ready for review label Jul 20, 2018
@ifyour
Copy link
Contributor Author

ifyour commented Jul 21, 2018

这一部分参考了语义化版本控制规范(SemVer)的翻译

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.

@huluoyang 看下 line#192 的评论

@ifyour 一些小问题,大部分是建议,你考虑下吧

"A semantic version number: 1.3.8",
"Instructions",
"In the dependencies-section of your package.json, change the version of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2"
"在 package.json 中,dependencies 这部分的 npm 包的版本号遵循所谓的语义化版本(SemVer),它是一种软件版本控制的行业标准,旨在使管理依赖项更加容易。在 npm 上发布的库、框架或其它工具都应该使用语义化版本(SemVer),以便可以清楚的告知用户,项目的依赖包在更新时可以预期的变化。",
Copy link
Contributor

Choose a reason for hiding this comment

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

以便可以清楚的告知用户,项目的依赖包在更新时可以预期的变化。 建议:

以便让使用该依赖包的用户能够在依赖包需要升级时,提前规划自己的项目需要为之做出的改动。

或者,如果你有更好的说法也行

"Instructions",
"In the dependencies-section of your package.json, change the version of moment to match MAJOR version 2, MINOR version 10 and PATCH version 2"
"在 package.json 中,dependencies 这部分的 npm 包的版本号遵循所谓的语义化版本(SemVer),它是一种软件版本控制的行业标准,旨在使管理依赖项更加容易。在 npm 上发布的库、框架或其它工具都应该使用语义化版本(SemVer),以便可以清楚的告知用户,项目的依赖包在更新时可以预期的变化。",
"在没有公共 API 的项目中,语义化版本(SemVer)没有意义 —— 除非你的项目与上面的例子类似,否则请使用其它的版本控制格式吧。",
Copy link
Contributor

Choose a reason for hiding this comment

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

注意,破折号两边应该是不需要额外空格的


版本控制格式 建议 =>
版本控制方式版本控制工具

"在 package.json 中,dependencies 这部分的 npm 包的版本号遵循所谓的语义化版本(SemVer),它是一种软件版本控制的行业标准,旨在使管理依赖项更加容易。在 npm 上发布的库、框架或其它工具都应该使用语义化版本(SemVer),以便可以清楚的告知用户,项目的依赖包在更新时可以预期的变化。",
"在没有公共 API 的项目中,语义化版本(SemVer)没有意义 —— 除非你的项目与上面的例子类似,否则请使用其它的版本控制格式吧。",
"为什么你需要了解语义化版本(SemVer)?",
"在开发使用外部依赖项的软件(大多数情况都是这样)时,了解语义化版本(SemVer)会很有用。有一天你会明白这些数字的含义,在项目中它可以避免你意外地引入一些重大更改,同时也能避免“昨天还是好好的”今天就不工作了这种情况发生。",
Copy link
Contributor

Choose a reason for hiding this comment

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

个人认为,breaking changes 翻译成 非向下兼容的更改非向前兼容的更改 应该会更确切。
我的理解是,主观意义上认为的“重大”不一定是 breaking changes;反之,小的改动也可以成为 breaking changes
另一方面,SemVer 的出现即是基于这种情景,而且它对版本号的定义也是基于此。它不允许 breaking changes 出现在 minor 与 patch increment,只有 major 可以。

所以,原文说的 save you from accidentally introducing breaking changes,我认为是 “非向下兼容的更改”

参考:https://en.wikipedia.org/wiki/Backward_compatibility


同时也能避免“昨天还是好好的”今天就不工作了这种情况发生。 =>
同时也能避免“昨天还能好好的运行,今天就不行了”这种情况发生。

  1. 引号貌似不太对
  2. 工作 不是很好,这里要表述的意思是“程序运行”。尽管,对应回英文都是 work

"为什么你需要了解语义化版本(SemVer)?",
"在开发使用外部依赖项的软件(大多数情况都是这样)时,了解语义化版本(SemVer)会很有用。有一天你会明白这些数字的含义,在项目中它可以避免你意外地引入一些重大更改,同时也能避免“昨天还是好好的”今天就不工作了这种情况发生。",
"根据语义化版本(SemVer)官方网站,它是这样规定的:",
"版本格式:主版本号.次版本号.修订号,版本号递增规则如下:",
Copy link
Contributor

Choose a reason for hiding this comment

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

建议 <code>主版本号.次版本号.修订号</code>

"在开发使用外部依赖项的软件(大多数情况都是这样)时,了解语义化版本(SemVer)会很有用。有一天你会明白这些数字的含义,在项目中它可以避免你意外地引入一些重大更改,同时也能避免“昨天还是好好的”今天就不工作了这种情况发生。",
"根据语义化版本(SemVer)官方网站,它是这样规定的:",
"版本格式:主版本号.次版本号.修订号,版本号递增规则如下:",
"主版本号:当你做了不兼容的 API 修改,",
Copy link
Contributor

Choose a reason for hiding this comment

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

当你做了不兼容的 API 修改, =>
当你做了不向下兼容的公共 API 修改,

"根据语义化版本(SemVer)官方网站,它是这样规定的:",
"版本格式:主版本号.次版本号.修订号,版本号递增规则如下:",
"主版本号:当你做了不兼容的 API 修改,",
"次版本号:当你做了向下兼容的功能性新增,",
Copy link
Contributor

Choose a reason for hiding this comment

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

当你做了向下兼容的功能性新增 =>

当你添加了向下兼容的新功能

"Instructions",
"Use the tilde-character (~) to prefix the version of moment in your dependencies and allow npm to update it to any new PATCH release.",
"Note that the version numbers themselves not should be changed."
"在最后一个挑战中,我们告诉 npm 只包含特定版本的依赖包。如果想让项目各个部分保持相互兼容,冻结依赖是一个有效的办法。但是大多数情况下,我们并不希望错过依赖项的问题修复,因为它们通常包含重要的安全补丁,并且希望这样可以持续正常的工作。",
Copy link
Contributor

Choose a reason for hiding this comment

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

冻结依赖 => 改成

定死依赖版本 会不会好些?


并且希望这样可以持续正常的工作。 =>

而且它们理论上也不该不兼容我们既有的代码。

因此,应该翻译成:=>

而且它们理论上也会兼容我们既有的代码。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

定死依赖版本 => 锁定定依赖包版本

这样会不会更书面化一点?😂

"Use the tilde-character (~) to prefix the version of moment in your dependencies and allow npm to update it to any new PATCH release.",
"Note that the version numbers themselves not should be changed."
"在最后一个挑战中,我们告诉 npm 只包含特定版本的依赖包。如果想让项目各个部分保持相互兼容,冻结依赖是一个有效的办法。但是大多数情况下,我们并不希望错过依赖项的问题修复,因为它们通常包含重要的安全补丁,并且希望这样可以持续正常的工作。",
"为了让 npm 依赖项更新到最新的修订版,你可以在依赖包的版本号前加一个波浪号(~)。在 package.json 中,我们当前的 moment 依赖包更新规则是:仅使用特定版本(2.10.2),但我们想用它最新的 2.10.x 版本。",
Copy link
Contributor

Choose a reason for hiding this comment

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

@huluoyang 这里,有没有必要多说一句,“英文的波浪号” 或者 “半角波浪号”?

Copy link
Contributor Author

@ifyour ifyour Jul 22, 2018

Choose a reason for hiding this comment

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

感觉英文的波浪号这样更严谨点 😁,同时也好理解

Copy link
Contributor

Choose a reason for hiding this comment

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

我觉得波浪号就挺好,加其它修饰都显得多余。

"在最后一个挑战中,我们告诉 npm 只包含特定版本的依赖包。如果想让项目各个部分保持相互兼容,冻结依赖是一个有效的办法。但是大多数情况下,我们并不希望错过依赖项的问题修复,因为它们通常包含重要的安全补丁,并且希望这样可以持续正常的工作。",
"为了让 npm 依赖项更新到最新的修订版,你可以在依赖包的版本号前加一个波浪号(~)。在 package.json 中,我们当前的 moment 依赖包更新规则是:仅使用特定版本(2.10.2),但我们想用它最新的 2.10.x 版本。",
"例子",
"<code>\"some-package-name\": \"~1.3.8\" 可以更新到任何 1.3.x 版本。</code>",
Copy link
Contributor

Choose a reason for hiding this comment

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

可以更新到任何 1.3.x 版本。 =>

是定义这个包允许使用的版本为 1.3.x。

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.

记得改一下,锁定定依赖包版本 => 锁定依赖包版本

别的没问题。LGTM 👍

"Instructions",
"Use the tilde-character (~) to prefix the version of moment in your dependencies and allow npm to update it to any new PATCH release.",
"Note that the version numbers themselves not should be changed."
"在最后一个挑战中,我们告诉 npm 只包含特定版本的依赖包。如果想让项目各个部分保持相互兼容,锁定定依赖包版本是一个有效的办法。但是大多数情况下,我们并不希望错过依赖项的问题修复,因为它们通常包含重要的安全补丁,而且它们理论上也会兼容我们既有的代码。",
Copy link
Contributor

Choose a reason for hiding this comment

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

锁定定依赖包版本 => 锁定依赖包版本

@S1ngS1ng S1ngS1ng added the comments addressed Use when a translation (?) PR has addressed all comments label Jul 22, 2018
Copy link
Contributor

@huluoyang huluoyang left a comment

Choose a reason for hiding this comment

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

部分翻译有待修改,离成功只有一个一步之遥了,加油。

"但是,如果想要删除不需要的依赖包,该怎么办呢?你可能已经猜到了——只需要删除 dependencies 中的键值对就行了。",
"同样的方法也适用于删除 package.json 中的其它字段",
"说明",
"删除 dependencies 中的 moment 依赖包。",
Copy link
Contributor

Choose a reason for hiding this comment

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

删除 dependencies 中的 moment 依赖包。
dependencies 本身就是依赖的意思,上文意思有重复,不够简洁。
建议修改成:删除 moment 依赖包。

"同样的方法也适用于删除 package.json 中的其它字段",
"说明",
"删除 dependencies 中的 moment 依赖包。",
"删除依赖包后,确保有正确数量的逗号。"
Copy link
Contributor

Choose a reason for hiding this comment

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

如果删除操作是最后一行,就会有多余的逗号。
所以这里建议修改成:删除依赖包后,确保没有多余的逗号。

],
"tests": [
{
"text": "\"dependencies\" should not include \"moment\"",
"testString": "getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert.notProperty(packJson.dependencies, 'moment', '\"dependencies\" still includes \"moment\"'); }, xhr => { throw new Error(xhr.responseText); })"
"text": "\"dependencies\" 未包含 \"moment\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

未包含 => 不包含

"Use the caret-character (^) to prefix the version of moment in your dependencies and allow npm to update it to any new MINOR release.",
"Note that the version numbers themselves not should be changed."
"和上一个挑战中我们学到的英文波浪号(~)来安装最新的修订版依赖一样,使用脱字符(^)允许 npm 来安装功能更新。它们的不同之处在于:脱字符(^)允许次版本和修订版更新。",
"此刻,你项目中的 moment 依赖包的版本应该是 ~2.10.2,这意味着 npm 可以安装 2.10.x 版的 moment,如果使用脱字符(^)来替换版本号的前缀,那么 npm 可以安装的版本则是 2.x.x。",
Copy link
Contributor

Choose a reason for hiding this comment

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

caret 建议翻译成插入符号,而不是脱字符。

"Use the tilde-character (~) to prefix the version of moment in your dependencies and allow npm to update it to any new PATCH release.",
"Note that the version numbers themselves not should be changed."
"在最后一个挑战中,我们告诉 npm 只包含特定版本的依赖包。如果想让项目各个部分保持相互兼容,锁定依赖包版本是一个有效的办法。但是大多数情况下,我们并不希望错过依赖项的问题修复,因为它们通常包含重要的安全补丁,而且它们理论上也会兼容我们既有的代码。",
"为了让 npm 依赖项更新到最新的修订版,你可以在依赖包的版本号前加一个英文的波浪号(~)。在 package.json 中,我们当前的 moment 依赖包更新规则是:仅使用特定版本(2.10.2),但我们想用它最新的 2.10.x 版本。",
Copy link
Contributor

Choose a reason for hiding this comment

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

tilde-character 建议统一翻译成:波浪符号,其他地方同理。

"text": "\"dependencies\" should not include \"moment\"",
"testString": "getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert.notProperty(packJson.dependencies, 'moment', '\"dependencies\" still includes \"moment\"'); }, xhr => { throw new Error(xhr.responseText); })"
"text": "\"dependencies\" 未包含 \"moment\"",
"testString": "getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert.notProperty(packJson.dependencies, 'moment', '\"dependencies\" 中任然有 \"moment\"'); }, xhr => { throw new Error(xhr.responseText); })"
Copy link
Contributor

Choose a reason for hiding this comment

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

任然有 => 仍然有

@huluoyang huluoyang changed the title translation part 5 translate managing-packages-with-npm.json Jul 24, 2018
@huluoyang huluoyang changed the title translate managing-packages-with-npm.json Translate managing-packages-with-npm Jul 24, 2018
@huluoyang huluoyang added need update Use when a translation (?) PR has been reviewed and needs to address comments and removed comments addressed Use when a translation (?) PR has addressed all comments ready for review Use when a translation (?) PR is ready for review labels Jul 24, 2018
@S1ngS1ng S1ngS1ng added :shipit: ship it Use when a translation (?) PR is ready for shipping and removed need update Use when a translation (?) PR has been reviewed and needs to address comments labels Jul 25, 2018
@huluoyang
Copy link
Contributor

🎉 恭喜明明成功完成第一个任务,Mission is impossible!

@huluoyang huluoyang merged commit b3b98c9 into FreeCodeCampChina:translate Jul 28, 2018
demongodYY pushed a commit to demongodYY/challenges that referenced this pull request Jul 30, 2018
* 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
S1ngS1ng added a commit to S1ngS1ng/challenges that referenced this pull request Jul 30, 2018
LynnLian pushed a commit to LynnLian/challenges that referenced this pull request Jul 30, 2018
* 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
hanx316 added a commit to hanx316/challenges that referenced this pull request Jul 31, 2018
wudifeixue pushed a commit that referenced this pull request Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:shipit: ship it Use when a translation (?) PR is ready for shipping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants