fix: some untranslated english

This commit is contained in:
Zhicheng Wang 2017-08-06 13:21:34 +08:00
parent 477be082fb
commit 3a584ba96c
20 changed files with 132 additions and 170 deletions

View File

@ -2,6 +2,8 @@
# 从 AngularJS 到 Angular 快速参考
// TODO: bugfix
{@a top}

View File

@ -215,7 +215,6 @@ transitions that apply regardless of which state the animation is in. For exampl
* The `* => *` transition applies when *any* change between two states takes place.
当在*任意*两个状态之间切换时,`* => *`转场都会生效。
<figure >

View File

@ -5,6 +5,8 @@
This cookbook describes how to radically improve performance by compiling _ahead-of-time_ (AOT)
during a build process.
本章描述了如何通过在构建期间使用预编译AOT编译技术来根本性的提高性能。
{@a overview}
## Overview
@ -441,6 +443,8 @@ Optional plugins filter and transform the Rollup inputs and output.
*RxJS*
*RxJS* 库
Rollup expects application source code to use `ES2015` modules.
Not all external dependencies are published as `ES2015` modules.
In fact, most are not. Many of them are published as _CommonJS_ modules.

View File

@ -634,13 +634,9 @@ Angular 还有少量指令,它们或者修改结构布局(例如 [ngSwitch](
Of course, you can also write your own directives. Components such as
`HeroListComponent` are one kind of custom directive.
<!-- PENDING: link to where to learn more about other kinds! -->
当然,我们也能编写自己的指令。像`HeroListComponent`这样的组件就是一种自定义指令。
<hr/>
## Services
## 服务

View File

@ -8,6 +8,8 @@ An **Attribute** directive changes the appearance or behavior of a DOM element.
Try the <live-example title="Attribute Directive example"></live-example>.
你可以到这里试试:<live-example title="Attribute Directive example"></live-example>
{@a directive-overview}
## Directives overview

View File

@ -283,4 +283,8 @@ to visit those features.
你最初的应用只有一个单一的模块 —— *根*模块。
当这个应用不断成长时,你就要考虑把它们拆分到多个 "特性" 模块中了。
这些特性模块中的一部分可以稍后加载即惰性加载它们只会在用户访问到这些特性时才会加载。When you're ready to explore these possibilities, visit the [NgModules](guide/ngmodule) guide.如果你要了解这些知识,请访问[Angular 模块 (NgModule)](guide/ngmodule)页
这些特性模块中的一部分可以稍后加载(即惰性加载),它们只会在用户访问到这些特性时才会加载。
When you're ready to explore these possibilities, visit the [NgModules](guide/ngmodule) guide.
如果你要了解这些知识,请访问[Angular 模块 (NgModule)](guide/ngmodule)页

View File

@ -226,7 +226,9 @@ Angular 在持续集成过程中,对每一个提交都会使用 <a href="https
## Polyfills #
## 填充库 (polyfill) #
Angular is built on the latest standards of the web platform.
Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.
@ -273,7 +275,9 @@ Note that polyfills cannot magically transform an old, slow browser into a moder
### Mandatory polyfills ##
### 强制性填充库 ##
These are the polyfills required to run an Angular application on each supported browser:
下表是填充库对每个支持的浏览器都是需要的:
@ -285,24 +289,17 @@ These are the polyfills required to run an Angular application on each supported
<th>
<p>
Browsers (Desktop & Mobile)
</p>
<p>
浏览器(桌面和移动)
</p>
</th>
<th>
<p>
Polyfills Required
</p>
<p>
需要的填充库
</p>
</th>
@ -316,6 +313,8 @@ These are the polyfills required to run an Angular application on each supported
<td>
None
</td>
</tr>
@ -345,16 +344,18 @@ These are the polyfills required to run an Angular application on each supported
[ES6<br>classList](guide/browser-support#classlist)
[ES6<br>classList](guide/browser-support#classlist) 支持
</td>
</tr>
</table>
### Optional browser features to polyfill ##
### 可选浏览器特性的填充库 ##
Some features of Angular may require additional polyfills.
有些 Angular 特性可能需要额外的填充库。
@ -507,38 +508,24 @@ Below are the polyfills which are used to test the framework itself. They are a
<tr>
<th>
<p>
Polyfill
</p>
<p>
填充库
</p>
</th>
<th>
<p>
Licence
</p>
<p>
授权方式
</p>
</th>
<th>
<p>
Size*
</p>
<p>
大小*
</p>
</th>
@ -568,13 +555,9 @@ Below are the polyfills which are used to test the framework itself. They are a
<td>
<p>
Public domain
</p>
<p>
公共域
</p>
公共领域
</td>
@ -666,8 +649,10 @@ Below are the polyfills which are used to test the framework itself. They are a
</table>
// TODO: Bugfix
\* Figures are for minified and gzipped code,
computed with the <a href="http://closure-compiler.appspot.com/home" >closure compiler</a>.\* 这些指标测量的是最小化 (minify) 并且 gzip 过的代码,使用 <a href="http://closure-compiler.appspot.com/home" target="_blank">closure compiler</a>
computed with the <a href="http://closure-compiler.appspot.com/home" >closure compiler</a>.
\* 这些指标测量的是最小化 (minify) 并且 gzip 过的代码,使用 <a href="http://closure-compiler.appspot.com/home" target="_blank">closure compiler</a>
计算出的结果。

View File

@ -250,6 +250,10 @@ The shadow-piercing descendant combinator is deprecated and [support is being re
As such we plan to drop support in Angular (for all 3 of `/deep/`, `>>>` and `::ng-deep`).
Until then `::ng-deep` should be preferred for a broader compatibility with the tools.
CSS标准中用于 "刺穿Shadow DOM" 的组合器已经被废弃,并将[这个特性从主流浏览器和工具中移除](https://www.chromestatus.com/features/6750456638341120)。
因此,我们也将在 Angular 中移除对它们的支持(包括`/deep/`、`>>>` 和 `::ng-deep`)。
目前,建议先统一使用`::ng-deep`,以便兼容将来的工具。
</div>
{@a loading-styles}

View File

@ -913,5 +913,10 @@ Read about how to enable CORS for specific servers at
## Next steps
## 下一步If you want to go beyond the [simple _copy-deploy_](guide/deployment#dev-deploy "Simplest deployment possible") approach,
read the [AOT Cookbook](guide/aot-compiler "AOT Cookbook") next.如果我们准备超越[简单*复制*部署](guide/deployment#dev-deploy "Simplest deployment possible")的方式,请参阅[烹饪宝典中的AOT部分](guide/aot-compiler "AOT Cookbook")。
## 下一步
If you want to go beyond the [simple _copy-deploy_](guide/deployment#dev-deploy "Simplest deployment possible") approach,
read the [AOT Cookbook](guide/aot-compiler "AOT Cookbook") next.
如果我们准备超越[简单*复制*部署](guide/deployment#dev-deploy "Simplest deployment possible")的方式,请参阅[烹饪宝典中的AOT部分](guide/aot-compiler "AOT Cookbook")。

View File

@ -117,7 +117,7 @@ because it doesn't render any additional output.
## Resolving components
### 解析组件
## 解析组件
Take a closer look at the methods in `ad-banner.component.ts`.
@ -245,7 +245,7 @@ add dynamically loaded components to the `NgModule`'s `entryComponents` array:
## The _AdComponent_ interface
### 公共的`AdComponent`接口
## 公共的`AdComponent`接口
In the ad banner, all components implement a common `AdComponent` interface to
standardize the API for passing data to the components.
@ -280,7 +280,7 @@ Here are two sample components and the `AdComponent` interface for reference:
## Final ad banner
### 最终的广告栏
## 最终的广告栏
The final ad banner looks like this:
@ -293,4 +293,6 @@ The final ad banner looks like this:
See the <live-example name="dynamic-component-loader"></live-example>.参见<live-example name="cb-dynamic-component-loader"></live-example>
See the <live-example name="dynamic-component-loader"></live-example>.
参见<live-example name="cb-dynamic-component-loader"></live-example>

View File

@ -250,7 +250,10 @@ Finally, display an instance of the form in the `AppComponent` shell.
{@a dynamic-template}
## Dynamic Template
## 动态模板Although in this example you're modelling a job application for heroes, there are
## 动态模板
Although in this example you're modelling a job application for heroes, there are
no references to any specific hero question
outside the objects returned by `QuestionService`.

View File

@ -248,7 +248,10 @@ on custom validation directives.
* The `#name` template variable is gone because the app no longer refers to the Angular control for this element.
模板变量`#name`消失了因为我们不再需要为这个元素引用Angular控制器。* Binding to the new `formErrors.name` property is sufficient to display all name validation error messages.
模板变量`#name`消失了因为我们不再需要为这个元素引用Angular控制器。
* Binding to the new `formErrors.name` property is sufficient to display all name validation error messages.
绑定到新的`formErrors.name`属性,就可以处理所有名字验证错误信息了。
{@a component-class}
@ -871,7 +874,7 @@ and whose value is an arbitrary dictionary of values that you could insert into
### Custom validation directive
#### 自定义验证指令
### 自定义验证指令
In the Reactive Forms component, the `'name'` control's validator function list
has a `forbiddenNameValidator` at the bottom.
@ -932,10 +935,15 @@ its `forbiddenName` property bound to “bob". If you were to replace
`useExisting` with `useClass`, then youd be registering a new class instance, one that
doesnt have a `forbiddenName`.
如果你熟悉 Angular 的验证机制,可能会注意到自定义验证指令是使用`useExisting`而不是`useClass`来实例化的。这是因为注册的验证器必须是这个 `ForbiddenValidatorDirective` 实例本身,也就是表单中 `forbiddenName` 属性被绑定到了"bob"的那个。如果用`useClass`来代替`useExisting`,就会注册一个新的类实例,而它是没有`forbiddenName`的。
To see this in action, run the example and then type “bob” in the name of Hero Form 2.
Notice that you get a validation error. Now change from `useExisting` to `useClass` and try again.
This time, when you type “bob”, there's no "bob" error message.
要查看它的运行效果请打开范例并在英雄表单2的 name 字段输入 "bob"。
注意,我们会看到一个验证错误。现在,把 `useExisting` 改成 `useClass` 再试一下。这次,当你敲 "bob" 时,就不会再出现错误信息了。
</div>

View File

@ -606,10 +606,14 @@ This guide follows that suggestion. It has a `locale` folder under `src/`.
Assets within the folder carry a filename extension that matches a language-culture code from a
<a href="https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx">well-known codeset</a>.
本指南遵循了那个建议。在`src/`目录下,有一个专门的`locale`目录,该目录中的文件都带有一个代号作为扩展名,它们来自这个<a href="https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx">众所周知的代号表</a>
Make a copy of the `messages.xlf` file, put it in the `locale` folder and
rename it `messages.es.xlf`for the Spanish language translation.
Do the same for each target language.
复制一下`messages.xlf`文件,把它放进`locale`目录,并改名为`messages.es.xlf`以用于西班牙语的翻译。对其它目标语言也同样要这么做。
{@a translate-text-nodes}
### Translate text nodes
@ -793,9 +797,7 @@ time to incorporate that translation into the application.
整个模板的翻译就完成了。现在就该把翻译结果放回到应用程序中了。
<a id='app-pre-translation'></a>
### The app before translation
### The app before translation<a id='app-pre-translation'></a>
### 翻译前的应用程序

View File

@ -806,7 +806,7 @@ The application would fail the moment a user navigated to "Heroes".
{@a q-component-or-module}
// TODO: bugfix
## Should I add other providers to a module or a component?
## 我应该把其它提供商注册到模块中还是组件中?
@ -1129,7 +1129,7 @@ although doing so is harmless.
## When do I add components to _entryComponents_?
### 什么时候我应该把组件加到`entryComponents`中?
## 什么时候我应该把组件加到`entryComponents`中?
Most application developers won't need to add components to the `entryComponents`.
@ -1169,7 +1169,7 @@ in the templates of other components.
## Why does Angular need _entryComponents_?
### 为什么Angular需要*入口组件*
## 为什么Angular需要*入口组件*
_Entry components_ are also declared.
Why doesn't the Angular compiler generate code for every component in `@NgModule.declarations`?
@ -1226,7 +1226,7 @@ the compiler omits it.
## What kinds of modules should I have and how should I use them?
#### 有哪些类型的模块?我应该如何使用它们?
## 有哪些类型的模块?我应该如何使用它们?
Every app is different. Developers have various levels of experience and comfort with the available choices.
Some suggestions and guidelines appear to have wide appeal.
@ -2206,7 +2206,7 @@ Real-world modules are often hybrids that knowingly deviate from these guideline
## What's the difference between Angular and JavaScript Modules?
### Angular模块和JavaScript模块有什么区别
## Angular模块和JavaScript模块有什么区别
Angular and JavaScript are different yet complementary module systems.
@ -2364,7 +2364,7 @@ Angular只查询两种组件、指令或管道1那些在当前模块中声
## What is the Angular compiler?
### 什么是Angular编译器
## 什么是Angular编译器
The Angular compiler converts the application code you write into highly performant JavaScript code.
The `@NgModule` metadata play an important role in guiding the compilation process.

View File

@ -2420,18 +2420,17 @@ Angular 创建一个惰性加载模块,它具有自己的注入器,它是根
## Conclusion
### 总结
## 总结
You made it! You can examine and download the complete source for this final version from the live example.
完工!你可以到下面的在线例子中试验它,并下载最终版本的全部源码。
<br/>
<live-example embedded img="guide/ngmodule/final-plunker.png"></live-example>
## Frequently asked questions
### 常见问题 (FAQ)
## 常见问题 (FAQ)
Now that you understand NgModules, you may be interested
in the companion [NgModule FAQs](guide/ngmodule-faq "NgModule FAQs") page

View File

@ -17,8 +17,8 @@ Node.js and npm are essential to Angular development.
Node.js和npm是做Angular开发的基础。
<a href="https://docs.npmjs.com/getting-started/installing-node" title="Installing Node.js and updating npm">
Get them now</a> if they're not already installed on your machine.
<p><a href="https://docs.npmjs.com/getting-started/installing-node" title="Installing Node.js and updating npm">
Get them now</a> if they're not already installed on your machine.</p>
如果你的电脑上还没有装过,请<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">立即获取它</a>

View File

@ -219,6 +219,9 @@ The wildcard route comes last because it matches _every URL_ and should be selec
If you need to see what events are happening during the navigation lifecycle, there is the **enableTracing** option as part of the router's default configuration. This outputs each router event that took place during each navigation lifecycle to the browser console. This should only be used for _debugging_ purposes. You set the `enableTracing: true` option in the object passed as the second argument to the `RouterModule.forRoot()` method.
如果我们想要看到在导航的生命周期中发生过哪些事件,可以使用路由器默认配置中的**enableTracing**选项。它会把每个导航生命周期中的事件输出到浏览器的控制台。
这应该只用于*调试*。我们只需要把`enableTracing: true`选项作为第二个参数传给`RouterModule.forRoot()`方法就可以了。
{@a basics-router-outlet}
@ -5982,7 +5985,7 @@ The appendix material isn't essential. Continued reading is for the curious.
### Appendix: link parameters array
## 附录:链接参数数组
### 附录:链接参数数组
A link parameters array holds the following ingredients for router navigation:
@ -6134,7 +6137,7 @@ any legal sequence of route paths, (required) router parameters, and (optional)
### Appendix: *LocationStrategy* and browser URL styles
## 附录:*LocationStrategy*以及浏览器URL样式
### 附录:*LocationStrategy*以及浏览器URL样式
When the router navigates to a new component view, it updates the browser's location and history
with a URL for that view.
@ -6217,7 +6220,7 @@ Learn about providers and the bootstrap process in the
#### Which strategy is best?
### 哪种策略更好?
#### 哪种策略更好?
You must choose a strategy and you need to make the right call early in the project.
It won't be easy to change later once the application is in production
@ -6251,7 +6254,7 @@ resort to hash routes.
#### HTML5 URLs and the *&lt;base href>*
### HTML 5 URL与*&lt;base href>*While the router uses the
#### HTML 5 URL与*&lt;base href>*While the router uses the
<a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API#Adding_and_modifying_history_entries" title="Browser history push-state">HTML5 pushState</a>
style by default, you *must* configure that strategy with a **base href**.

View File

@ -20,17 +20,12 @@ You can run the <live-example></live-example> in Plunker and download the code f
<h2 id='report-issues'>
<p>
Reporting vulnerabilities
</p>
<p>
举报漏洞
</p>
</h2>
<h2 id='report-issues'>
举报漏洞
</h2>
To report vulnerabilities in Angular itself, email us at [security@angular.io](mailto:security@angular.io).
@ -45,17 +40,12 @@ philosophy](https://www.google.com/about/appsecurity/).
<h2 id='best-practices'>
<p>
Best practices
</p>
<p>
最佳实践
</p>
</h2>
<h2 id='best-practices'>
最佳实践
</h2>
* **Keep current with the latest Angular library releases.**
@ -80,21 +70,9 @@ For more information, see the [Trusting safe values](guide/security#bypass-secur
**避免使用本文档中带“[_安全风险_](guide/security#bypass-security-apis)”标记的Angular API。**
要了解更多信息,请参阅本章的[信任那些安全的值](guide/security#bypass-security-apis)部分。
## Preventing cross-site scripting (XSS) <a id="xss"></a>
<h2 id='xss'>
<p>
Preventing cross-site scripting (XSS)
</p>
<p>
防范跨站脚本(XSS)攻击
</p>
</h2>
## 防范跨站脚本(XSS)攻击
[Cross-site scripting (XSS)](https://en.wikipedia.org/wiki/Cross-site_scripting) enables attackers
to inject malicious code into web pages. Such code can then, for example, steal user data (in

View File

@ -490,6 +490,8 @@ All are preceded by the keyword `let`.
这个例子中有好几个模板输入变量:`hero`、`i`和`odd`。
它们都是用`let`作为前导关键字。
// TODO: Translate
A _template input variable_ is **_not_** the same as a
[template _reference_ variable](guide/template-syntax#ref-vars),
neither _semantically_ nor _syntactically_.

View File

@ -58,15 +58,11 @@ Note that the resulting code does not map to the docs. Adjust accordingly.
<h2 id='prereq1'>
<p>
Prerequisite: Node.js
</p>
</h2>
<p>
<h2 id='prereq1'>
前提条件: Node.js
</p>
</h2>
@ -93,15 +89,11 @@ Older versions produce errors.
<h2 id='prereq2'>
<p>
Prerequisite: Visual Studio 2015 Update 3
</p>
</h2>
<p>
<h2 id='prereq2'>
前提条件: Visual Studio 2015 Update 3
</p>
</h2>
@ -122,15 +114,11 @@ Or use `Tools | Extensions and Updates` to update to Update 3 directly from Visu
<h2 id='prereq3'>
<p>
Prerequisite: Configure External Web tools
</p>
</h2>
<p>
<h2 id='prereq3'>
前提条件: 配置External Web tools
</p>
</h2>
@ -173,15 +161,11 @@ Visual Studio将优先在当前的工作区查找外部工具如果没有找
<h2 id='prereq4'>
<p>
Prerequisite: Install TypeScript 2.2 for Visual Studio 2015
</p>
</h2>
<p>
<h2 id='prereq4'>
前提条件: 安装TypeScript 2.2 for Visual Studio 2015
</p>
</h2>
@ -215,15 +199,11 @@ restart it to make sure everything is clean.
<h2 id='download'>
<p>
Step 1: Download the QuickStart files
</p>
</h2>
<p>
<h2 id='download'>
第一步: 现在“快速起步”文件
</p>
</h2>
@ -236,15 +216,11 @@ from GitHub. If you downloaded as a zip file, extract the files.
<h2 id='create-project'>
<p>
Step 2: Create the Visual Studio ASP.NET project
</p>
</h2>
<p>
<h2 id='create-project'>
第二步创建Visual Studio ASP.net项目
</p>
</h2>
@ -321,35 +297,23 @@ Include the files in the Visual Studio project as follows:
src/app目录如果询问是否要搜索TypeScript类型回答*No*
* src/styles.css
* src/index.html
* package.json
* src/tsconfig.json
* typings.json
<h2 id='restore'> Step 4: Restore the required packages </h2>
<h2 id='restore'>
<p>
Step 4: Restore the required packages
</p>
<p>
第四步: 恢复需要的包
</p>
</h2>
<h2 id='restore'> 第四步: 恢复需要的包 </h2>
// TODO: bugfix
Restore the packages required for an Angular application as follows: