diff --git a/aio/tools/translator/bin/translate-all.ts b/aio/tools/translator/bin/translate-all.ts
new file mode 100644
index 0000000000..3436397cab
--- /dev/null
+++ b/aio/tools/translator/bin/translate-all.ts
@@ -0,0 +1,5 @@
+#!/usr/bin/env ts-node
+import { dirs } from '../dirs';
+import { translateDirectory } from '../translate';
+
+translateDirectory(__dirname + '/../../../../../content-en/', dirs.content);
diff --git a/aio/tools/translator/bin/translate-one.ts b/aio/tools/translator/bin/translate-one.ts
new file mode 100644
index 0000000000..17e5c2dd80
--- /dev/null
+++ b/aio/tools/translator/bin/translate-one.ts
@@ -0,0 +1,6 @@
+#!/usr/bin/env ts-node
+
+import { dirs } from '../dirs';
+import { translateFile } from '../translate';
+
+translateFile(__dirname + '/../../../../../content-en/' + 'guide/http.md', dirs.content + 'guide/http.md');
diff --git a/aio/tools/translator/dict-1.json b/aio/tools/translator/dict-1.json
index 69290be7e5..1a6307fc61 100644
--- a/aio/tools/translator/dict-1.json
+++ b/aio/tools/translator/dict-1.json
@@ -295,7 +295,7 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "### ng-hide\n In AngularJS, the `ng-hide` directive shows or hides the associated HTML element based on\n an expression. For more information, see [ng-show](guide/ajs-quick-reference#ng-show).",
+ "original": "In AngularJS, the `ng-hide` directive shows or hides the associated HTML element based on\n an expression. For more information, see [ng-show](guide/ajs-quick-reference#ng-show).",
"translation": "在AngularJS中,`ng-hide`指令会基于一个表达式显示或隐藏相关的HTML元素。\n 参见[ng-show](guide/ajs-quick-reference#ng-show)了解更多。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
@@ -569,6 +569,11 @@
"translation": "基于过滤条件从指定的集合中选取出一个子集。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
+ {
+ "original": "### none",
+ "translation": "### 没了\n For performance reasons, no comparable pipe exists in Angular. Do all your filtering in the component. If you need the same filtering code in several templates, consider building a custom pipe.",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
+ },
{
"original": "Converts a JavaScript object into a JSON string. This is useful for debugging.",
"translation": "把一个JavaScript对象转换成一个JSON字符串。这对调试很有用。",
@@ -619,6 +624,11 @@
"translation": "使用表达式中所指定的方式对集合进行排序。\n 在这个例子中,`movieList`被根据movie的title排序了。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
+ {
+ "original": "### none",
+ "translation": "### 没了\n For performance reasons, no comparable pipe exists in Angular.\n Instead, use component code to order or sort results. If you need the same ordering or sorting code in several templates, consider building a custom pipe.",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
+ },
{
"original": "## Modules/controllers/components",
"translation": "## 模块/控制器/组件",
@@ -689,6 +699,11 @@
"translation": "要了解关于模块的更多知识,参见[NgModules](guide/ngmodule)。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
+ {
+ "original": "### Controller registration",
+ "translation": "### 控制器注册",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
+ },
{
"original": "AngularJS has code in each controller that looks up an appropriate Angular module\n and registers the controller with that module.",
"translation": "在AngularJS中,在每个控制器中都有一些代码,用于找到合适的Angular模块并把该控制器注册进去。",
@@ -805,7 +820,7 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "### StyleUrls\n In Angular, you can use the `styles` or `styleUrls` property of the `@Component` metadata to define\n a style sheet for a particular component.",
+ "original": "In Angular, you can use the `styles` or `styleUrls` property of the `@Component` metadata to define\n a style sheet for a particular component.",
"translation": "在Angular中,我们可以在`@Component`的元数据中使用`styles`或`styleUrls`属性来为一个特定的组件定义样式表。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
@@ -824,6 +839,11 @@
"translation": "动画是现代Web应用设计中一个很重要的方面。我们希望用户界面能在不同的状态之间更平滑的转场。如果需要,还可以用适当的动画来吸引注意力。\n设计良好的动画不但会让UI更有趣,还会让它更容易使用。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/animations.md"
},
+ {
+ "original": "## Overview",
+ "translation": "## 概述",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/animations.md"
+ },
{
"original": "Angular's animation system lets you build animations that run with the same kind of native\nperformance found in pure CSS animations. You can also tightly integrate your\nanimation logic with the rest of your application code, for ease of control.",
"translation": "Angular的动画系统赋予了制作各种动画效果的能力,以构建出与原生CSS动画性能相同的动画。\n我们也获得了额外的让动画逻辑与其它应用代码紧紧集成在一起的能力,这让动画可以被更容易的触发与控制。",
@@ -1219,6 +1239,11 @@
"translation": "其中一个动画组对元素的`transform`和`width`做动画,另一个组则对`opacity`做动画。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/animations.md"
},
+ {
+ "original": "## Animation callbacks",
+ "translation": "## 动画回调",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/animations.md"
+ },
{
"original": "A callback is fired when an animation is started and also when it is done.",
"translation": "当动画开始和结束时,会触发一个回调。",
@@ -1280,8 +1305,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/aot-compiler.md"
},
{
- "original": "{@a aot-jit}",
- "translation": "## _Ahead-of-time_ (AOT) vs _just-in-time_ (JIT)\n## 预编译(AOT) vs 即时编译(JIT)",
+ "original": "## _Ahead-of-time_ (AOT) vs _just-in-time_ (JIT)",
+ "translation": "## 预编译(AOT) vs 即时编译(JIT)",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/aot-compiler.md"
},
{
@@ -3384,6 +3409,11 @@
"translation": "Angular 在持续集成过程中,对每一个提交都会使用 SauceLabs 和\nBrowserstack 在上述所有浏览器上执行单元测试。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
},
+ {
+ "original": "## Polyfills #",
+ "translation": "## 填充库 (polyfill) #\nAngular is built on the latest standards of the web platform.\nTargeting such a wide range of browsers is challenging because they do not support all features of modern browsers.",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
+ },
{
"original": "You can compensate by loading polyfill scripts (\"polyfills\") on the host web page (`index.html`)\nthat implement missing features in JavaScript.",
"translation": "你可以通过在宿主页面 (`index.html`) 中加载填充脚本 (“polyfills”) 来加以弥补,这些脚本实现了浏览器缺失的 JavaScript 特性。",
@@ -3404,6 +3434,11 @@
"translation": "这些建议的填充库是运行完整 Angular 应用所需的。\n你可能还会需要另一些的填充库来支持没有出现在此列表中的哪些特性。\n注意,这些填充库并没有神奇的魔力来把老旧、慢速的浏览器变成现代、快速的浏览器,它只是填充了 API。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
},
+ {
+ "original": "### Mandatory polyfills ##",
+ "translation": "### 强制性填充库 ##\nThese are the polyfills required to run an Angular application on each supported browser:",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
+ },
{
"original": "Browsers (Desktop & Mobile)",
"translation": "浏览器(桌面和移动)",
@@ -3414,6 +3449,11 @@
"translation": "需要的填充库",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
},
+ {
+ "original": "### Optional browser features to polyfill ##",
+ "translation": "### 可选浏览器特性的填充库 ##\nSome features of Angular may require additional polyfills.",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
+ },
{
"original": "For example, the animations library relies on the standard web animation API, which is only available in Chrome and Firefox today.\nYou'll need a polyfill to use animations in other browsers.",
"translation": "例如,动画库依赖于标准的 web 动画 API,目前它只在 Chrome 和 Firefox 上可用。你可能需要一个填充库来在其它浏览器上使用动画功能。",
@@ -3474,6 +3514,11 @@
"translation": "用 [Http](guide/http) 发送和接收二进制数据",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
},
+ {
+ "original": "### Suggested polyfills ##",
+ "translation": "### 建议的填充库 ##\nBelow are the polyfills which are used to test the framework itself. They are a good starting point for an application.",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/browser-support.md"
+ },
{
"original": "Polyfill",
"translation": "填充库",
@@ -3521,7 +3566,12 @@
},
{
"original": "## All mention of moduleId removed. \"Component relative paths\" guide deleted (2017-03-13)",
- "translation": "## 移除了所有的moduleId引用。移除了“组件相对路径” 的烹饪书。(2017-03-13)\nWe added a new SystemJS plugin (systemjs-angular-loader.js) to our recommended SystemJS configuration.\nThis plugin dynamically converts \"component-relative\" paths in templateUrl and styleUrls to \"absolute paths\" for you.",
+ "translation": "## 移除了所有的moduleId引用。移除了“组件相对路径” 的烹饪书。(2017-03-13)",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/change-log.md"
+ },
+ {
+ "original": "We added a new SystemJS plugin (systemjs-angular-loader.js) to our recommended SystemJS configuration.\nThis plugin dynamically converts \"component-relative\" paths in templateUrl and styleUrls to \"absolute paths\" for you.",
+ "translation": "我们往建议的SystemJS配置中新增了一个SystemJS插件 (systemjs-angular-loader.js) 。\n这个插件可以帮你把templateUrl和styleUrls中的组件相对路径动态转换为绝对路径。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/change-log.md"
},
{
@@ -3626,7 +3676,7 @@
},
{
"original": "## Miscellaneous (2017-01-05)",
- "translation": "## 杂项 (2017-01-05)* [Setup](guide/setup) guide: \nadded (optional) instructions on how to remove _non-essential_ files. [环境搭建](guide/setup)指南:\n 添加了(可选的)步骤说明,告诉你如何移除*非核心*文件。",
+ "translation": "## 杂项 (2017-01-05)* [Setup](guide/setup) guide:",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/change-log.md"
},
{
@@ -6060,8 +6110,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a why-di }",
- "translation": "## Why dependency injection?\n## 为什么需要依赖注入?",
+ "original": "## Why dependency injection?",
+ "translation": "## 为什么需要依赖注入?",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6220,8 +6270,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a angular-di}",
- "translation": "## Angular dependency injection\n## Angular 依赖注入",
+ "original": "## Angular dependency injection",
+ "translation": "## Angular 依赖注入",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6280,8 +6330,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a injector-config}",
- "translation": "### Configuring the injector\n### 配置注入器",
+ "original": "### Configuring the injector",
+ "translation": "### 配置注入器",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6350,8 +6400,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a prep-for-injection}",
- "translation": "### Preparing the _HeroListComponent_ for injection\n### 为注入准备`HeroListComponent`",
+ "original": "### Preparing the _HeroListComponent_ for injection",
+ "translation": "### 为注入准备`HeroListComponent`",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6359,6 +6409,11 @@
"translation": "`HeroListComponent`应该从注入的`HeroService`获取英雄数据。\n遵照依赖注入模式的要求,组件必须在它的构造函数中请求这些服务,[就像以前解释过的那样](guide/dependency-injection#ctor-injection)。\n只是个小改动:",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
+ {
+ "original": "#### Focus on the constructor",
+ "translation": "#### 来看看构造函数",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
+ },
{
"original": "Adding a parameter to the constructor isn't all that's happening here.",
"translation": "往构造函数中添加参数并不是这里所发生的一切。",
@@ -6390,8 +6445,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a singleton-services}",
- "translation": "### Singleton services\n### 单例服务",
+ "original": "### Singleton services",
+ "translation": "### 单例服务",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6405,8 +6460,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a testing-the-component}",
- "translation": "### Testing the component\n### 测试组件",
+ "original": "### Testing the component",
+ "translation": "### 测试组件",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6425,8 +6480,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a service-needs-service}",
- "translation": "### When the service needs a service\n### 当服务需要别的服务时",
+ "original": "### When the service needs a service",
+ "translation": "### 当服务需要别的服务时",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6560,8 +6615,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a providers}",
- "translation": "## Injector providers\n## 注入器的提供商们",
+ "original": "## Injector providers",
+ "translation": "## 注入器的提供商们",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6775,8 +6830,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a token}",
- "translation": "## Dependency injection tokens\n## 依赖注入令牌",
+ "original": "## Dependency injection tokens",
+ "translation": "## 依赖注入令牌",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -6879,6 +6934,11 @@
"translation": "或者在 ngModule 中提供并注入这个配置对象,如`AppModule`。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
+ {
+ "original": "## Optional dependencies",
+ "translation": "## 可选依赖",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
+ },
{
"original": "The `HeroService` *requires* a `Logger`, but what if it could get by without\na `logger`?\nYou can tell Angular that the dependency is optional by annotating the\nconstructor argument with `@Optional()`:",
"translation": "`HeroService`*需要*一个`Logger`,但是如果想不提供 Logger 也能得到它,该怎么办呢?\n可以把构造函数的参数标记为`@Optional()`,告诉 Angular 该依赖是可选的:",
@@ -6889,6 +6949,11 @@
"translation": "当使用`@Optional()`时,代码必须准备好如何处理空值。\n如果其它的代码没有注册一个 `logger`,注入器会设置该`logger`的值为空 null。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
+ {
+ "original": "## Summary",
+ "translation": "## 总结",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
+ },
{
"original": "You learned the basics of Angular dependency injection in this page.\nYou can register various kinds of providers,\nand you know how to ask for an injected object (such as a service) by\nadding a parameter to a constructor.",
"translation": "本章,我们学习了 Angular 依赖注入的基础知识。\n我们可以注册很多种类的提供商,知道如何通过添加构造函数的参数来请求一个注入对象(例如一个服务)。",
@@ -6900,8 +6965,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
- "original": "{@a explicit-injector}",
- "translation": "## Appendix: Working with injectors directly\n## 附录:直接使用注入器",
+ "original": "## Appendix: Working with injectors directly",
+ "translation": "## 附录:直接使用注入器",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/dependency-injection.md"
},
{
@@ -15899,6 +15964,11 @@
"translation": "回到根模块`AppModule`,把这个`AppRoutingModule`添加到根模块的`imports`列表中,该应用就可以正常导航了。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/ngmodule.md"
},
+ {
+ "original": "### Routing to a feature module",
+ "translation": "### 路由到特性模块",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ngmodule.md"
+ },
{
"original": "The `src/app/contact` folder holds a new file, `contact-routing.module.ts`.\nIt defines the `contact` route mentioned earlier and provides a `ContactRoutingModule` as follows:",
"translation": "`src/app/contact`目录中也有一个新文件`contact-routing.module.ts`。\n它定义了我们前面提到过的`联系人`路由,并提供了`ContactRoutingModule`,就像这样:",
@@ -16859,6 +16929,11 @@
"translation": "要了解更多`DatePipes`的格式选项,请参阅[API文档](api/common/DatePipe)。",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/pipes.md"
},
+ {
+ "original": "## Chaining pipes",
+ "translation": "## 链式管道",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/pipes.md"
+ },
{
"original": "You can chain pipes together in potentially useful combinations.\nIn the following example, to display the birthday in uppercase,\nthe birthday is chained to the `DatePipe` and on to the `UpperCasePipe`.\nThe birthday displays as **APR 15, 1988**.",
"translation": "我们可以把管道链在一起,以组合出一些潜在的有用功能。\n下面这个例子中,我们把`birthday`链到`DatePipe`管道,然后又链到`UpperCasePipe`,这样我们就可以把生日显示成大写形式了。\n比如下面的代码就会把生日显示成**APR 15, 1988**:",
@@ -20535,8 +20610,8 @@
"sourceFile": "/Users/twer/private/GDE/content-1/guide/router.md"
},
{
- "original": "{@a optional-route-parameters}",
- "translation": "### Route Parameters: Required or optional?\n### 路由参数:必须还是可选?",
+ "original": "### Route Parameters: Required or optional?",
+ "translation": "### 路由参数:必须还是可选?",
"sourceFile": "/Users/twer/private/GDE/content-1/guide/router.md"
},
{
@@ -22799,6 +22874,11 @@
"translation": "为了防范XSS攻击,我们必须阻止恶意代码进入DOM。比如,如果某个攻击者能骗我们把`