Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
把英文双引号修正为中文的
Browse files Browse the repository at this point in the history
  • Loading branch information
asnowwolf committed May 7, 2017
1 parent 8baa278 commit 83105da
Showing 26 changed files with 172 additions and 91 deletions.
2 changes: 1 addition & 1 deletion public/docs/ts/latest/cookbook/aot-compiler.jade
Original file line number Diff line number Diff line change
@@ -708,7 +708,7 @@ code-example(language="none" class="code-shell").
Develop as usual.
The server and TypeScript compiler are in "watch mode" so your changes are reflected immediately in the browser.

照常开发。服务器和TypeScript编译器都处于"监听模式",因此我们的修改都可以立刻反映到浏览器中。
照常开发。服务器和TypeScript编译器都处于监听模式,因此我们的修改都可以立刻反映到浏览器中。

To see those changes in AOT, switch to the original terminal and re-run `npm run build:aot`.
When it finishes, go back to the browser and use the back button to
8 changes: 4 additions & 4 deletions public/docs/ts/latest/cookbook/form-validation.jade
Original file line number Diff line number Diff line change
@@ -241,7 +241,7 @@ a#template2

Here's the hero name again, excerpted from the revised template (Template 2), next to the original version:

下面也是关于英雄名字的控制器,从修改后的模板("Template 2")中抽取出来,与原来的版本相比:
下面也是关于英雄名字的控制器,从修改后的模板(Template 2)中抽取出来,与原来的版本相比:

+makeTabs(
`cb-form-validation/ts/src/app/template/hero-form-template2.component.html,
@@ -785,9 +785,9 @@ a#custom-validation
the validator rejects any hero name containing "bob".
Elsewhere it could reject "alice" or any name that the configuring regular expression matches.

在本例中,禁止的名字是"bob"
验证器拒绝任何带有"bob"的英雄名字。
在其他地方,只要配置的正则表达式可以匹配上,它可能拒绝"alice"或者任何其他名字。
在本例中,禁止的名字是bob
验证器拒绝任何带有bob的英雄名字。
在其他地方,只要配置的正则表达式可以匹配上,它可能拒绝alice或者任何其他名字。

The `forbiddenNameValidator` factory returns the configured validator function.
That function takes an Angular control object and returns _either_
2 changes: 1 addition & 1 deletion public/docs/ts/latest/cookbook/ngmodule-faq.jade
Original file line number Diff line number Diff line change
@@ -1516,7 +1516,7 @@ table
See also [Do you need a _Routing Module_?](../guide/router.html#why-routing-module) on the
[Routing & Navigation](../guide/router.html) page.

参见[路由与导航](../guide/router.html)一章的"[你需要**路由模块**吗?](../guide/router.html#why-routing-module)"部分。
参见[路由与导航](../guide/router.html)一章的[你需要**路由模块**吗?](../guide/router.html#why-routing-module)部分。

tr
td(style="vertical-align: top") <a id="service-feature-module"></a>
2 changes: 1 addition & 1 deletion public/docs/ts/latest/cookbook/ts-to-js.jade
Original file line number Diff line number Diff line change
@@ -476,7 +476,7 @@ a#dsl

这个 _TypeScript_ "getter" 属性会翻译成 _ES5_ <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty"
target="_blank" title="Defined Properties">已定义属性</a>。
_ES5 DSL_ 不直接支持_已定义属性_,你仍可提取"类"原型,象下面这样添加_已定义属性_:
_ES5 DSL_ 不直接支持_已定义属性_,你仍可提取“类”原型,象下面这样添加_已定义属性_:

+makeExample('cb-ts-to-js/js/src/app/hero-queries.component.js', 'defined-property','js/src/app/hero-queries.component.ts')(format='.')

2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/architecture.jade
Original file line number Diff line number Diff line change
@@ -977,7 +977,7 @@ figure

> It displays a price of 42.33 as `$42.33`.

> 它把价格"42.33"显示为`$42.33`。
> 它把价格42.33显示为`$42.33`。

> [**Router**](router.html): Navigate from page to page within the client
application and never leave the browser.
8 changes: 4 additions & 4 deletions public/docs/ts/latest/guide/change-log.jade
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ block includes

## All mention of moduleId removed. "Component relative paths" cookbook deleted (2017-03-13)

## 移除了所有的moduleId引用。移除了"组件相对路径" 的烹饪书。(2017-03-13)
## 移除了所有的moduleId引用。移除了组件相对路径 的烹饪书。(2017-03-13)

We added a new SystemJS plugin (systemjs-angular-loader.js) to our recommended SystemJS configuration.
This plugin dynamically converts "component-relative" paths in templateUrl and styleUrls to "absolute paths" for you.
@@ -35,7 +35,7 @@ block includes
Look for the new download links next to the "live example" links.

现在你可以为任何一篇指南下载范例程序,并且在本地运行它了。
请在"在线例子"的链接后面查找新的下载链接。
请在在线例子的链接后面查找新的下载链接。

## Template Syntax/Structural Directives: refreshed (2017-02-06)

@@ -246,12 +246,12 @@ block includes

## ES6 described in "TypeScript to JavaScript" (2016-11-14)

## 在"从TypeScript到JavaScript"增加ES6的描述 (2016-11-14)
## 在从TypeScript到JavaScript增加ES6的描述 (2016-11-14)

The updated [TypeScript to JavaScript](../cookbook/ts-to-js.html) cookbook
now explains how to write apps in ES6/7

更新了"[从TypeScript到JavaScript](../cookbook/ts-to-js.html)"烹饪宝典,解释如何使用ES6/7编写应用
更新了[从TypeScript到JavaScript](../cookbook/ts-to-js.html)烹饪宝典,解释如何使用ES6/7编写应用

by translating the common idioms in the TypeScript documentation examples
(and elsewhere on the web) to ES6/7 and ES5.
2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/dependency-injection.jade
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ block includes

* [Non-class dependencies](#non-class-dependencies)

[非"类"依赖](#non-class-dependencies)
[非“类”依赖](#non-class-dependencies)

* [`InjectionToken`](#injection-token)

6 changes: 3 additions & 3 deletions public/docs/ts/latest/guide/deployment.jade
Original file line number Diff line number Diff line change
@@ -285,7 +285,7 @@ a#node-modules

1. Add the "Simple deployment" sample files shown above.

添加上述的"简单部署"范例文件。
添加上述的简单部署范例文件。

1. Run it with `npm start` as you would any project.

@@ -520,7 +520,7 @@ a#measure
You can waste a lot of time and money optimizing something that has no tangible benefit or even makes the app slower.
You should measure the app's actual behavior when running in the environments that are important to you.

如果我们能对"是什么导致了应用变慢"的问题有一个清晰、准确的理解,那就可以对优化什么、如何优化做出更好地决策了。
如果我们能对是什么导致了应用变慢的问题有一个清晰、准确的理解,那就可以对优化什么、如何优化做出更好地决策了。
真正的原因可能并不是你所想的那样。
我们可能花费大量的时间和金钱去优化一些东西,但它却无法产生可感知的效果甚至让应用变得更慢。
我们应该在那些最重要的环境中实际运行,来度量应用的实际行为。
@@ -702,7 +702,7 @@ a#deep-link
For example, `http://www.mysite.com/heroes/42` is a _deep link_ to the hero detail page
that displays the hero with `id: 42`.

带路由的应用应该支持"深链接"
带路由的应用应该支持深链接
所谓*深链接*就是指一个URL,它用于指定到应用内某个组件的路径。
比如,`http://www.mysite.com/heroes/42`就是一个到英雄详情页面的*深链接*,用于显示`id: 42`的英雄。

8 changes: 4 additions & 4 deletions public/docs/ts/latest/guide/forms.jade
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ figure.image-display

* The `@Component` selector value of "hero-form" means you can drop this form in a parent template with a `<hero-form>` tag.

`@Component`选择器"hero-form"表示可以用`<hero-form>`标签把这个表单放进父模板。
`@Component`选择器hero-form表示可以用`<hero-form>`标签把这个表单放进父模板。

* The `templateUrl` property points to a separate file for the template HTML.

@@ -357,7 +357,7 @@ figure.image-display

Replace the contents of the "QuickStart" version with the following:

"快速起步"的版本内容替换成下列代码:
快速起步的版本内容替换成下列代码:

+makeExample('src/app/app.component.ts')

@@ -975,8 +975,8 @@ figure.image-display
`#heroForm`, and initialized it with the value "ngForm".
Now, use that variable to access the form with the Submit button.

我们已经定义了一个模板引用变量`#heroForm`,并且把赋值为"ngForm"
现在,就可以在"Submit"按钮中访问这个表单了。
我们已经定义了一个模板引用变量`#heroForm`,并且把赋值为ngForm
现在,就可以在Submit按钮中访问这个表单了。

:marked
You'll bind the form's overall validity via
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ figure.image-display

服务解析逻辑会自下而上查找,碰到的第一个提供商会胜出。
因此,注入器树中间层注入器上的提供商,可以拦截来自底层的对特定服务的请求。
这导致它可以"重新配置"和者说"遮蔽"高层的注入器。
这导致它可以重新配置和者说“遮蔽”高层的注入器。

If you only specify providers at the top level (typically the root `AppModule`), the tree of injectors appears to be flat.
All requests bubble up to the root <code>NgModule</code> injector that you configured with the `bootstrapModule` method.
2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/index.jade
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ block includes
If you're new to Angular, you may want to visit "[Learning Angular](learning-angular.html)" first.

本页是 Angular 文档的概述。
如果你刚接触 Angular,请先访问"[学习 Angular](learning-angular.html)"
如果你刚接触 Angular,请先访问[学习 Angular](learning-angular.html)

## Themes

2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/learning-angular.jade
Original file line number Diff line number Diff line change
@@ -73,4 +73,4 @@ figure
Try the [tutorial](../tutorial "Tour of Heroes") if you're ready to start coding or
visit the [Architecture](architecture.html "Basic Concepts") page if you prefer to learn the basic concepts first.

如果你想开始编程,那就试试[教程](../tutorial "英雄指南")。或者如果你想要先学习基本概念,那么阅读[架构](architecture.html "基本概念")页面。
如果你想开始编程,那就试试[教程](../tutorial 英雄指南)。或者如果你想要先学习基本概念,那么阅读[架构](architecture.html 基本概念)页面。
16 changes: 8 additions & 8 deletions public/docs/ts/latest/guide/npm-packages.jade
Original file line number Diff line number Diff line change
@@ -305,26 +305,26 @@ a(id="why-peer-dependencies")
Two packages, "A" and "B", could depend on the same third package "C".
"A" and "B" might both list "C" among their *dependencies*.

两个包,"A"和"B",可能依赖共同的第三个包"C"
"A"和"B"可能都在它们的*dependencies*中列出了"C"
两个包,“A”和“B”,可能依赖共同的第三个包“C”
"A"和“B”可能都在它们的*dependencies*中列出了“C”

What if "A" and "B" depend on different versions of "C" ("C1" and "C2"). The npm package system supports that.
It installs "C1" in the `node_modules` folder for "A" and "C2" in the `node_modules` folder for "B".
Now "A" and "B" have their own copies of "C" and they run without interferring with one another.

如果"A"和"B"依赖于"C"的不同版本("C1"和"C2")。npm包管理系统也能支持!
它会把"C1"安装到"A"的`node_modules`目录下给"A"用,把"C2"安装到"B"的`node_modules`目录下给"B"用。
现在,"A"和"B"都有了它们自己的一份"C"的复本,它们运行起来也互不干扰。
如果“A”和“B”依赖于“C”的不同版本("C1"和“C2”)。npm包管理系统也能支持!
它会把“C1”安装到“A”的`node_modules`目录下给“A”用,把“C2”安装到“B”的`node_modules`目录下给“B”用。
现在,“A”和“B”都有了它们自己的一份“C”的复本,它们运行起来也互不干扰。

But there is a problem. Package "A" may require the presence of "C1" without actually calling upon it directly.
"A" may only work if *everyone is using "C1"*. It falls down if any part of the application relies on "C2".

但是有一个问题。包"A"可能只需要"C1"出现就行,而实际上并不会直接调用它。
"A"可能只有当*每个人都使用"C1"时*才能正常工作。如果程序中的任何一个部分依赖了"C2",它就会失败。
但是有一个问题。包“A”可能只需要“C1”出现就行,而实际上并不会直接调用它。
"A"可能只有当*每个人都使用“C1”时*才能正常工作。如果程序中的任何一个部分依赖了“C2”,它就会失败。

The solution is for "A" to declare that "C1" is a *peer dependency*.

要想解决这个问题,"A"就需要把"C1"定义为它的*平级依赖*。
要想解决这个问题,“A”就需要把“C1”定义为它的*平级依赖*。

The difference between a `dependency` and a `peerDependency` is roughly this:

2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/pipes.jade
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ block includes
"**<samp>04/15/1988</samp>**" and
"**<samp>Friday, April 15, 1988</samp>**".

当我们点击按钮的时候,显示的日志会在"**<samp>04/15/1988</samp>**"和"**<samp>Friday, April 15, 1988</samp>**"之间切换。
当我们点击按钮的时候,显示的日志会在**<samp>04/15/1988</samp>**”和“**<samp>Friday, April 15, 1988</samp>**之间切换。

figure.image-display
img(src='/resources/images/devguide/pipes/date-format-toggle-anim.gif' alt="Date Format Toggle")
24 changes: 12 additions & 12 deletions public/docs/ts/latest/guide/reactive-forms.jade
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ include ../_util-fns
This guide explains reactive forms as you follow the steps to build a "Hero Detail Editor" form.

*响应式表单*是Angular中用*响应式*风格创建表单的技术。
本章中,我们会在构建"英雄详情编辑器"的过程中,逐步讲解响应式表单的概念。
本章中,我们会在构建英雄详情编辑器的过程中,逐步讲解响应式表单的概念。

a#toc
:marked
@@ -221,7 +221,7 @@ a#async-vs-sync
from within the component class.

模板驱动表单会委托指令来创建它们的表单控件。
为了消除"检查完后又变化了"的错误,这些指令需要消耗一个以上的变更检测周期来构建整个控件树。
为了消除检查完后又变化了的错误,这些指令需要消耗一个以上的变更检测周期来构建整个控件树。
这意味着在从组件类中操纵任何控件之前,我们都必须先等待一个节拍。

For example, if you inject the form control with a `@ViewChild(NgForm)` query and examine it in the
@@ -252,7 +252,7 @@ a#async-vs-sync
Choose the approach that works best for you.
You may decide to use both in the same application.

没有哪个"更好"
没有哪个“更好”
它们是两种架构范式,各有优缺点。
请自行选择更合适的方法,甚至可以在同一个应用中同时使用它们。

@@ -1531,9 +1531,9 @@ a#form-array

务必确保**添加了`type="button"`属性**。
事实上,我们应该总是指定按钮的`type`。
如果不明确指定类型,按钮的默认类型就是"submit"(提交)。
当我们稍后添加了*表单提交*的动作时,每个"submit"按钮都是触发一次提交操作,而它将可能会做一些处理,比如保存当前的修改。
我们显然不会希望每当用户点击"Add a Secret Lair"按钮时就保存一次。
如果不明确指定类型,按钮的默认类型就是submit(提交)。
当我们稍后添加了*表单提交*的动作时,每个submit按钮都是触发一次提交操作,而它将可能会做一些处理,比如保存当前的修改。
我们显然不会希望每当用户点击Add a Secret Lair按钮时就保存一次。

:marked
### Try it!
@@ -1543,7 +1543,7 @@ a#form-array
Back in the browser, select the hero named "Magneta".
"Magneta" doesn't have an address, as you can see in the diagnostic JSON at the bottom of the form.

回到浏览器中,选择名叫"Magneta"的英雄。
回到浏览器中,选择名叫Magneta的英雄。
"Magneta"没有地址,我们会在表单底部的诊断用JSON中看到这一点。

figure.image-display
@@ -1553,7 +1553,7 @@ figure.image-display
Click the "_Add a Secret Lair_" button.
A new address section appears. Well done!

点击"Add a Secret Lair"按钮,一个新的地址区就出现了,干得好!
点击Add a Secret Lair按钮,一个新的地址区就出现了,干得好!

### Remove a lair

@@ -1617,7 +1617,7 @@ a#observe-control
Return to the browser, select a hero (e.g, "Magneta"), and start typing in the _name_ input box.
You should see a new name in the log after each keystroke.

返回浏览器,选择一个英雄(比如"Magneta"),并开始在*姓名*输入框中键入。
返回浏览器,选择一个英雄(比如Magneta),并开始在*姓名*输入框中键入。
我们会看到,每次按键都会记录一个新名字。

### When to use it
@@ -1715,21 +1715,21 @@ figure.image-display

Add the "Save" and "Revert" buttons near the top of the component's template:

"Save"和"Revert"按钮添加到组件模板的顶部:
Save”和“Revert按钮添加到组件模板的顶部:

+makeExample('reactive-forms/ts/src/app/hero-detail.component.html', 'buttons','src/app/hero-detail.component.html (Save and Revert buttons)')(format=".")

:marked
The buttons are disabled until the user "dirties" the form by changing a value in any of its form controls (`heroForm.dirty`).

这些按钮默认是禁用的,直到用户通过修改任何一个表单控件的值"弄脏"了表单中的数据(即`heroForm.dirty`)。
这些按钮默认是禁用的,直到用户通过修改任何一个表单控件的值“弄脏”了表单中的数据(即`heroForm.dirty`)。

Clicking a button of type `"submit"` triggers the `ngSubmit` event which calls the component's `onSubmit` method.
Clicking the revert button triggers a call to the component's `revert` method.
Users now can save or revert changes.

点击一个类型为`"submit"`的按钮会触发`ngSubmit`事件,而它会调用组件的`onSubmit`方法。
点击"Revert"按钮则会调用组件的`revert`方法。
点击Revert按钮则会调用组件的`revert`方法。
现在,用户可以保存或放弃修改了。

This is the final step in the demo.
Loading

0 comments on commit 83105da

Please sign in to comment.