fix: 翻译遗漏的内容

This commit is contained in:
Zhicheng WANG 2019-01-04 15:43:45 +08:00
parent 8957bbf209
commit 3e02cb65fc
20 changed files with 54 additions and 37 deletions

View File

@ -137,7 +137,6 @@ Command syntax is shown as follows:
ng build my-app -c production
</code-example>
选项名带有双中线前缀(--)。
选项别名带有单中线前缀(-)。
参数没有前缀。

View File

@ -330,6 +330,8 @@ Angular has more pre-defined directives that either alter the layout structure
or modify aspects of DOM elements and components
(for example, [ngStyle](guide/template-syntax#ngStyle) and [ngClass](guide/template-syntax#ngClass)).
Angular 还有很多预定义指令既不修改布局结构(比如 [ngSwitch](guide/template-syntax#ngSwitch)),也不修改 DOM 元素和组件的样子(比如 [ngStyle](guide/template-syntax#ngStyle) 和 [ngClass](guide/template-syntax#ngClass))。
<div class="alert is-helpful">
Learn more in the [Attribute Directives](guide/attribute-directives) and [Structural Directives](guide/structural-directives) guides.

View File

@ -101,9 +101,11 @@ When you create a component, it's associated directly with a single view, called
树中的视图可以嵌套到任意深度。
<div class="alert is-helpful">
**Note:** The hierarchical structure of views is a key factor in the way Angular detects and responds to changes in the DOM and app data.
**注意:** 视图的这种层次结构是 Angular 在 DOM 和应用数据中检测与响应变更时的关键因素。
</div>
## NgModules and JavaScript modules
@ -128,6 +130,7 @@ JavaScript 中,每个*文件*是一个模块,文件中定义的所有对象
<code-example path="architecture/src/app/app.module.ts" region="export" linenums="false"></code-example>
<div class="alert is-helpful">
<a href="http://exploringjs.com/es6/ch_modules.html">Learn more about the JavaScript module system on the web.</a>
<a href="http://exploringjs.com/es6/ch_modules.html">学习更多关于 JavaScript 模块的知识。</a>

View File

@ -200,12 +200,12 @@ Any option that your build supports can be overridden in a build target configur
To build using the staging configuration, run the following command:
要想使用预生产环境staging的配置进行构建请运行下列命令
<code-example language="sh" class="code-shell">
ng build --configuration=staging
</code-example>
要想使用预生产环境进行构建,请运行 `ng build --configuration=staging`
You can also configure the `serve` command to use the targeted build configuration if you add it to the "serve:configurations" section of `angular.json`:
如果将其添加到 `angular.json` 的 "serve:configurations" 区段,你还可以配置 `serve` 命令来使用 目标构建配置:

View File

@ -393,12 +393,14 @@ You should measure the app's actual behavior when running in the environments th
你可能花费了大量的时间和金钱来优化一些实际上无关紧要的东西,甚至可能让应用变得更慢。
你应该测量应用在运行环境中的实际行为,这才是最重要的。
<p>
The
<a href="https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing" title="Chrome DevTools Network Performance">
Chrome DevTools Network Performance page</a> is a good place to start learning about measuring performance.
</p>
<a href="https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing" title="Chrome DevTools Network Performance">
Chrome DevTools 的网络和性能页</a>是你开始学习如何测量性能的好地方。
<p><a href="https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing" title="Chrome DevTools Network Performance">
Chrome DevTools 的网络和性能页</a>是你开始学习如何测量性能的好地方。</p>
The [WebPageTest](https://www.webpagetest.org/) tool is another good choice
that can also help verify that your deployment was successful.

View File

@ -22,7 +22,7 @@ Transforming a component to a custom element makes all of the required Angular i
Creating a custom element is simple and straightforward, and automatically connects your component-defined view with change detection and data binding, mapping Angular functionality to the corresponding native HTML equivalents.
把组件转换成自定义元素可以让所有所需的 Angular 基础设施都在浏览器中可用。
创建自定义元素的方式简单直接,并且会自动把你组件定义的视图连同变更检测与数据绑定等 Anuglar 的功能映射为相应的原生 HTML 等价物。
创建自定义元素的方式简单直接,并且会自动把你组件定义的视图连同变更检测与数据绑定等 Angular 的功能映射为相应的原生 HTML 等价物。
<div class="alert is-helpful">
@ -36,8 +36,6 @@ Creating a custom element is simple and straightforward, and automatically conne
</div>
把组件转换成自定义元素会让所需的 Angular 基础设施也可用在浏览器中。创建自定义元素非常简单直接,它会自动把你的组件视图对接到变更检测和数据绑定机制,会把 Angular 的功能映射到原生 HTML 中的等价物。
## Using custom elements
## 使用自定义元素

View File

@ -521,7 +521,7 @@ Choosing a strategy begins with understanding the strengths and weaknesses of th
## Next steps
后续步骤
## 后续步骤
To learn more about reactive forms, see the following guides:
@ -546,4 +546,7 @@ To learn more about template-driven forms, see the following guides:
* [Template-driven Forms](guide/forms#template-driven-forms)
[模板驱动表单](guide/forms)
* [Form Validation](guide/form-validation#template-driven-validation)
[表单验证](guide/form-validation#template-driven-validation)

View File

@ -40,8 +40,6 @@ By compiling your application using the `ngc` command-line tool, you can bootstr
{@a angular-element}
可以与[即时(JIT)编译](guide/glossary#jit)对比一下。
## Angular element
## Angular 元素element
@ -361,9 +359,6 @@ Don't declare the following:
非 Angular 的类和对象,比如:字符串、数字、函数、实体模型、配置、业务逻辑和辅助类
非 Angular 的类和对象,比如:字符串、数字、函数、实体模型、配置、业务逻辑和辅助类。
{@a decorator}
{@a decoration}
@ -1042,13 +1037,17 @@ When using reactive forms:
构建响应式表单时:
* The "source of truth", the form model, is defined in the component class.
"权威数据源"(表单模型)定义在组件类中。
* Validation is set up through validation functions rather than valdation directives.
组件是“权威数据源”。表单验证在组件代码中定义。
表单验证在组件代码而不是验证器指令中定义。
* Each control is explicitly created in the component class by creating a `FormControl` instance manually or with `FormBuilder`.
在组件类中,使用 `new FormControl()` 或者 `FormBuilder` 显性地创建每个控件。
* The template input elements do *not* use `ngModel`.
模板中的 `input` 元素**不**使用 `ngModel`

View File

@ -251,7 +251,6 @@ When you configure a provider for a component or directive using the `providers`
* Learn more about [Element Injectors in Angular](https://blog.angularindepth.com/a-curios-case-of-the-host-decorator-and-element-injectors-in-angular-582562abcf0a).
欲知详情,参见[Angular 中的元素注入器](https://blog.angularindepth.com/a-curios-case-of-the-host-decorator-and-element-injectors-in-angular-582562abcf0a)。
## Injector bubbling

View File

@ -64,8 +64,6 @@ After you have set up your app to use i18n, the CLI can help you with the follow
为你的应用创建多语言版本。
本文档集中讲解 [**Angular CLI**](https://cli.angular.io/) 项目Angular CLI 为它生成了写多语言应用时必须的大部分样板代码。
{@a setting-up-locale}
## Setting up the locale of your app
@ -527,8 +525,6 @@ You can use regular expressions with the `plural` and `select` clauses to provid
### 复数规则
不同的语言有不同的单复数规则。
Suppose that you want to say that something was "updated x minutes ago".
In English, depending upon the number of minutes, you could display "just now", "one minute ago",
or "x minutes ago" (with x being the actual number).
@ -1233,6 +1229,8 @@ the CLI configuration file, `angular.json`.
The same configuration options can also be provided through the CLI with your existing `production` configuration.
这些配置项还可以通过 CLI 参数和现有的 `production` 配置来提供。
<code-example language="sh" class="code-shell">
ng build --prod --i18n-file src/locale/messages.fr.xlf --i18n-format xlf --i18n-locale fr
</code-example>

View File

@ -139,12 +139,12 @@ The following support packages are included as dependencies in the default `pack
新的 Angular 工作空间的 `package.json` 文件中默认包含下列支持包。
Package name | Description
包名 | 说明
---------------------------------------- | --------------------------------------------------
包名 | 说明
[**rxjs**](https://github.com/ReactiveX/rxjs) | Many Angular APIs return [_observables_](guide/glossary#observable). RxJS is an implementation of the proposed [Observables specification](https://github.com/tc39/proposal-observable) currently before the [TC39](https://www.ecma-international.org/memento/tc39-m.htm) committee, which determines standards for the JavaScript language.
[**rxjs**](https://github.com/ReactiveX/rxjs) | 很多 Angular API 都会返回[*可观察对象*](guide/glossary#observable)。RxJS 是对计划中的 [Observable 规范的实现](https://github.com/tc39/proposal-observable) currently before the [TC39](https://www.ecma-international.org/memento/tc39-m.htm) committee, which determines standards for the JavaScript language.
[**rxjs**](https://github.com/ReactiveX/rxjs) | 很多 Angular API 都会返回[*可观察对象*](guide/glossary#observable)。RxJS 是对计划中的 [Observable 规范的实现](https://github.com/tc39/proposal-observable),它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范。
[**zone.js**](https://github.com/angular/zone.js) | Angular relies on zone.js to run Angular's change detection processes when native JavaScript operations raise events. Zone.js is an implementation of a [specification](https://gist.github.com/mhevery/63fdcdf7c65886051d55) currently before the [TC39](http://www.ecma-international.org/memento/TC39.htm) committee that determines standards for the JavaScript language.
[**zone.js**](https://github.com/angular/zone.js) | 当原生 JavaScript 操作发生事件时Angular 要依靠 zone.js 来运行 Angular 的变更检测过程。 Zone.js 是对一个[规范](https://gist.github.com/mhevery/63fdcdf7c65886051d55)的实现,它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范.
[**zone.js**](https://github.com/angular/zone.js) | 当原生 JavaScript 操作发生事件时Angular 要依靠 zone.js 来运行 Angular 的变更检测过程。 Zone.js 是对一个[规范](https://gist.github.com/mhevery/63fdcdf7c65886051d55)的实现,它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范
{@a polyfills}
### Polyfill packages

View File

@ -185,6 +185,7 @@ Notice that if you subscribe twice, there will be two separate streams, each emi
<code-example path="observables/src/multicasting.ts" region="multicast_sequence" header="Create a multicast subscriber"></code-example>
<div class="alert is-helpful">
Multicasting observables take a bit more setup, but they can be useful for certain applications. Later we will look at tools that simplify the process of multicasting, allowing you to take any observable and make it multicasting.
虽然支持多播的可观察对象需要做更多的准备工作,但对某些应用来说,这非常有用。稍后我们会介绍一些简化多播的工具,它们让你能接收任何可观察对象,并把它变成支持多播的。

View File

@ -579,7 +579,7 @@ display updates as you add heroes, even when you mutate the `heroes` array.
<h3 class="no-toc">The impure <i>AsyncPipe</i></h3>
<h3 id='async-pipe'>非纯 <i>AsyncPipe</i></h3>
<h3 class="no-toc">非纯 <i>AsyncPipe</i></h3>
The Angular `AsyncPipe` is an interesting example of an impure pipe.
The `AsyncPipe` accepts a `Promise` or `Observable` as input

View File

@ -1302,7 +1302,7 @@ Generate a sample application to follow the walkthrough.
### Define Routes
#### 定义路由
### 定义路由
A router must be configured with a list of route definitions.
@ -1349,6 +1349,8 @@ The first configuration defines an array of two routes with simple paths leading
Replace the contents of each component with the sample HTML below.
把每个组件的内容都替换成下列范例 HTML。
<code-tabs>
<code-pane header="src/app/crisis-list/crisis-list.component.html" path="router/src/app/crisis-list/crisis-list.component.html">
@ -4251,9 +4253,12 @@ A guard's return value controls the router's behavior:
如果它返回 `true`,导航过程会继续
* If it returns `false`, the navigation process stops and the user stays put.
如果它返回 `false`,导航过程就会终止,且用户留在原地。
* If it returns a `UrlTree`, the current navigation cancels and a new navigation is initiated to the `UrlTree` returned.
如果它返回 `false`,导航过程会终止,且用户会留在原地。
如果它返回 `UrlTree`,则取消当前的导航,并且开始导航到返回的这个 `UrlTree`.
<div class="alert is-helpful">
@ -4660,6 +4665,8 @@ The `AuthGuard` should call an application service that can login a user and ret
Update the `AuthService` to log in the user:
修改 `AuthService` 以登入此用户:
<code-example path="router/src/app/auth/auth.service.ts" linenums="false" header="src/app/auth/auth.service.ts (excerpt)">
</code-example>
@ -5099,9 +5106,6 @@ If it doesn't return a valid `Crisis`, return an empty `Observable`, canceling t
</code-example>
`CrisisService.getCrisis` 方法返回了一个可观察对象,这是为了防止在数据获取完毕前加载路由。
如果它没有返回一个有效的 `Crisis`,就把用户导航回 `CrisisListComponent`,并取消以前到 `CrisisDetailComponent` 尚未完成的导航。
Import this resolver in the `crisis-center-routing.module.ts`
and add a `resolve` object to the `CrisisDetailComponent` route configuration.

View File

@ -90,6 +90,7 @@ RxJS 提供了很多操作符,不过只有少数是常用的。
下面是一个常用操作符的列表和用法范例,参见 [RxJS API 文档](https://rxjs-dev.firebaseapp.com/api)。
<div class="alert is-helpful">
Note that, for Angular apps, we prefer combining operators with pipes, rather than chaining. Chaining is used in many RxJS examples.
注意,对于 Angular 应用来说,我们提倡使用管道来组合操作符,而不是使用链式写法。链式写法仍然在很多 RxJS 中使用着。

View File

@ -64,7 +64,7 @@ The above command completes the following actions:
创建一个名叫 [`ngsw-config.json`](/guide/service-worker-config) 的 Service Worker 配置文件,它会用来指定缓存的行为以及其它设定。
Now, build the project:
Now, build the project:
现在,构建本项目:

View File

@ -2235,11 +2235,13 @@ you can still fall back to the traditional technique
and pass `it` a function that takes a
[`done` callback](https://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support).
虽然 `async``fakeAsync` 函数极大地简化了 Angular 的异步测试,不过你仍然可以回退到传统的技术中。
也就是说给 `it` 额外传入一个函数型参数,这个函数接受一个 [`done` 回调](http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support)。
You can't call `done()` in `async()` or `fakeAsync()` functions, because the `done parameter`
is `undefined`.
虽然 `async``fakeAsync` 函数极大地简化了 Angular 的异步测试,不过你仍然可以回退到传统的技术中。
也就是说给 `it` 额外传入一个函数型参数,这个函数接受一个 [`done` 回调](http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support)。
但你不能在 `async()``fakeAsync()` 函数中调用 `done()`,因为它的 `done` 参数是 `undefined`
Now you are responsible for chaining promises, handling errors, and calling `done()` at the appropriate moments.
@ -4884,6 +4886,7 @@ Here are the most important static methods, in order of likely utility.
</tr>
</table>
A few of the `TestBed` instance methods are not covered by static `TestBed` _class_ methods.
These are rarely needed.

View File

@ -205,7 +205,6 @@ QuickStart identifies two *typings*, or `d.ts`, files:
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *Node.js®* environment;
[node](https://www.npmjs.com/package/@types/node)是为了在 *Node.js®* 环境中引用对象的代码提供的类型定义。
QuickStart doesn't require these typings but many of the samples do.

View File

@ -44,7 +44,7 @@ Meanwhile, the browser downloads the full client version and switches to it auto
## Why use server-side rendering?
### 为何需要 Universal
## 为何需要服务端渲染?
There are three main reasons to create a Universal version of your app.
@ -73,6 +73,7 @@ There are three main reasons to create a Universal version of your app.
Google, Bing, Facebook, Twitter, and other social media sites rely on web crawlers to index your application content and make that content searchable on the web.
Google、Bing、Facebook、Twitter 和其它社交媒体网站都依赖网络爬虫去索引你的应用内容,并且让它的内容可以通过网络搜索到。
These web crawlers may be unable to navigate and index your highly interactive Angular application as a human user could do.
这些网络爬虫可能不会像人类那样导航到你的具有高度交互性的 Angular 应用,并为其建立索引。
@ -765,10 +766,11 @@ This guide covers them in the sections below.
### Using absolute URLs for server requests
#### 在 HTTP 中使用绝对地址
### 在 HTTP 中使用绝对地址
The tutorial's `HeroService` and `HeroSearchService` delegate to the Angular `HttpClient` module to fetch application data.
These services send requests to _relative_ URLs such as `api/heroes`.
教程中的 `HeroService``HeroSearchService` 都委托了 Angular 的 `HttpClient` 模块来获取应用数据。
那些服务都把请求发送到了*相对* URL比如 `api/heroes`
@ -863,7 +865,7 @@ which then forwards it to the client in the HTTP response.
### Filtering request URLs
#### 过滤请求的 URL
### 过滤请求的 URL
The web server must distinguish _app page requests_ from other kinds of requests.
@ -913,6 +915,8 @@ Node Express 服务器是一系列中间件构成的管道,它会挨个对 URL
<div class="alert is-helpful">
**Note:** This sample server doesn't handle data requests.
**注意:**这个范例服务器不会处理数据请求。
The tutorial's "in-memory web API" module, a demo and development tool, intercepts all HTTP calls and
simulates the behavior of a remote data server.
@ -932,7 +936,7 @@ The following code filters for request URLs with no extensions and treats them a
### Serving static files safely
#### 安全的提供静态文件
### 安全的提供静态文件
A single `app.use()` treats all other URLs as requests for static assets
such as JavaScript, image, and style files.

View File

@ -128,6 +128,8 @@ that primes the in-memory database.
The class `src/app/in-memory-data.service.ts` is generated by the following command:
`src/app/in-memory-data.service.ts` 类是通过下列命令生成的:
<code-example language="sh" class="code-shell">
ng generate service InMemoryData
</code-example>