Merge branch 'master' of https://github.com/angular/angular-cn into dreamapple-contribute

This commit is contained in:
dreamapple 2016-07-03 00:34:24 +08:00
commit 402c2917f5
27 changed files with 179 additions and 73 deletions

View File

@ -13,7 +13,7 @@ else
.c3.main-footer-branding
.logo-inverse-large
.c3
.c2
h3.text-headline RESOURCES
h3.text-headline 资源库
@ -31,7 +31,7 @@ else
li <a href="/presskit.html">Press Kit</a>
li <a href="/presskit.html">宣传资料</a>
.c3
.c2
h3.text-headline HELP
h3.text-headline 帮助
@ -47,13 +47,13 @@ else
li <a class="footer-feedback" ng-click="appCtrl.openFeedback()" aria-label="Submit feedback on this page"> Site Feedback</a>
li <a class="footer-feedback" ng-click="appCtrl.openFeedback()" aria-label="Submit feedback on this page"> 网站反馈</a>
.c3
.c2
h3.text-headline COMMUNITY
h3.text-headline 社区
ul.text-body
li <a href="/events.html">Events</a>
li <a href="/events.html">事件</a>
li <a href="/events.html">会议</a>
li <a href="http://www.meetup.com/topics/angularjs/">Meetups</a>
li <a href="http://www.meetup.com/topics/angularjs/">Meetups</a>
li <a href="https://twitter.com/angularjs"> Twitter</a>
@ -63,6 +63,12 @@ else
li <a href="/contribute.html"> Contribute</a>
li <a href="/contribute.html"> 做贡献</a>
.c2
h3.text-headline LANGUAGES
h3.text-headline 其它语种
ul.text-body
li <a href="https://angular.io/" target="_blank">英文版</a>
footer(class="background-steel")
p
@ -72,5 +78,5 @@ else
small.text-caption.translated-cn Powered by Google ©2010-2016. 代码授权协议:<a href="/license" class="text-snow">MIT式协议</a>。 文档授权协议:<a class="text-snow" href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
a(aria-label="View Style Guide" href=styleguide title="Style Guide" class="styleguide-trigger text-snow" md-button)
span.icon-favorite
a(aria-label="查看风格指南" href=styleguide title="风格指南" class="styleguide-trigger text-snow translated-cn" md-button)
a(aria-label="查看风格指南" href="/docs/ts/latest/styleguide.html" title="风格指南" class="styleguide-trigger text-snow translated-cn" md-button)
span.icon-favorite

View File

@ -10,10 +10,9 @@ md-toolbar(class="main-nav background-regal l-pinned-top l-layer-5",scroll-y-off
ul(ng-class="appCtrl.showMainNav ? 'is-visible' : ''")
li.l-left <a class="main-nav-button" href="/features.html" md-button>特性</a>
li.l-left <a class="main-nav-button" href="/docs/#{language}/latest/" md-button>文档</a>
li.l-left <a class="main-nav-button" href="/events.html" md-button>开发者会议</a>
li.l-left <a class="main-nav-button" href="/events.html" md-button>会议</a>
li.l-left <a class="main-nav-button" href="/news.html" md-button>新闻</a>
li.l-left <a class="main-nav-button" href="/translate/cn/about.html" md-button>关于中文版</a>
li.l-left <a class="main-nav-button" href="https://angular.io/" md-button target="_blank">英文版</a>
li.l-left <a class="main-nav-button" href="/translate/cn/home.html" md-button>关于中文版</a>
li.l-right <a class="main-nav-button" href="/docs/ts/latest/quickstart.html" md-button>立即开始!</a>
li.l-right
a.main-nav-button.md-button(ng-click="appCtrl.toggleSource($event)", href)

View File

@ -32,7 +32,7 @@
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.1",
"@angular/router": "3.0.0-beta.2",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",

View File

@ -1,5 +1,4 @@
// #docregion
// #docregion import
// #docregion , import
import 'package:angular2/core.dart';
// #enddocregion import

View File

@ -1,5 +1,5 @@
# #docregion
name: angular2_getting_started
name: angular2_quickstart
description: QuickStart
version: 0.0.1
environment:

View File

@ -1,7 +1,7 @@
// #docregion
import 'package:angular2/platform/browser.dart';
import 'package:angular2_getting_started/app_component.dart';
import 'package:angular2_quickstart/app_component.dart';
void main() {
bootstrap(AppComponent);

View File

@ -10,7 +10,7 @@ export const CrisisCenterRoutes: RouterConfig = [
{
path: '',
redirectTo: '/crisis-center',
terminal: true
pathMatch: 'full'
},
// #enddocregion redirect
{

View File

@ -12,7 +12,7 @@ export const CrisisCenterRoutes: RouterConfig = [
{
path: '',
redirectTo: '/crisis-center',
terminal: true
pathMatch: 'full'
},
{
path: 'crisis-center',

View File

@ -13,7 +13,7 @@ export const CrisisCenterRoutes: RouterConfig = [
{
path: '',
redirectTo: '/crisis-center',
terminal: true
pathMatch: 'full'
},
{
path: 'crisis-center',

View File

@ -12,7 +12,7 @@ export const CrisisCenterRoutes: RouterConfig = [
{
path: '',
redirectTo: '/crisis-center',
terminal: true
pathMatch: 'full'
},
{
path: 'crisis-center',

View File

@ -3,7 +3,7 @@
<html>
<head>
<!-- #docregion base-href -->
<base href=".">
<base href="/">
<!-- #enddocregion base-href -->
<title>Router Sample v.1</title>
<meta charset="UTF-8">

View File

@ -2,7 +2,7 @@
<!-- #docregion -->
<html>
<head>
<base href=".">
<base href="/">
<title>Router Sample v.2</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -2,7 +2,7 @@
<!-- #docregion -->
<html>
<head>
<base href=".">
<base href="/">
<title>Router Sample v.3</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -4,7 +4,7 @@
<html>
<head>
<!-- Set the base href -->
<base href=".">
<base href="/">
<title>Router Sample</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -11,7 +11,7 @@ export const routes: RouterConfig = [
{
path: '',
redirectTo: '/dashboard',
terminal: true
pathMatch: 'full'
},
// #enddocregion redirect-route
// #docregion dashboard-route

View File

@ -11,7 +11,7 @@ export const routes: RouterConfig = [
{
path: '',
redirectTo: '/dashboard',
terminal: true
pathMatch: 'full'
},
{
path: 'dashboard',

View File

@ -9,7 +9,7 @@ export const routes: RouterConfig = [
{
path: '',
redirectTo: '/dashboard',
terminal: true
pathMatch: 'full'
},
{
path: 'dashboard',

View File

@ -167,7 +167,7 @@ block server-watching
block project-file-structure
.filetree
.file angular2-quickstart
.file angular2_quickstart
.children
.file lib
.children

View File

@ -27,7 +27,7 @@ p Run the #[+liveExampleLink2('', 'toh-5')] for this part.
and hero detail component. If not, well need to go back and follow the previous chapters.
.filetree
.file angular2-tour-of-heroes
.file angular2_tour_of_heroes
.children
.file lib
.children
@ -659,7 +659,7 @@ p.
:marked
.filetree
.file angular2-tour-of-heroes
.file angular2_tour_of_heroes
.children
.file lib
.children

View File

@ -91,7 +91,7 @@ block review
block filetree
.filetree
.file angular2-tour-of-heroes
.file angular2_tour_of_heroes
.children
.file lib
.children

View File

@ -1891,26 +1891,21 @@ code-example(format="").
它无法匹配上我们配置过的任何路由,这意味着在应用启动的时候它将不会显示任何组件。
用户必须点击一个导航链接来触发导航并显示点什么。
We want the application to display the list of crises as it would if we pasted `localhost:3000/crisis-center/` into the address bar.
We prefer that the application display the list of crises as it would if the user clicked the "Crisis Center" link or pasted `localhost:3000/crisis-center/` into the address bar.
This is our intended default route.
我们希望该应用显示一个危机列表,就像在地址栏输入`localhost:3000/crisis-center/`时一样。这就是默认路由。
当用户点击了“Crisis Center”链接或者在地址栏粘贴`localhost:3000/crisis-center/`时,我们更希望该应用能直接显示危机列表。这就是默认路由。
We can arrange for that behavior in several ways.
One way is to use a `redirect` to transparently navigate from one route to another.
The preferred solution is to add a `redirect` route that transparently translates from the initial URL (`''`) to the preferred default path (`/crisis-center`):
我们可以用多种方式实现此行为。其一是使用`redirect`来从一个路由透明的导航到另一个。
In our example, we'll add a route to match our initial URL and redirect to our `crisis-center` route:
在这个例子中我们将添加一个路由来匹配最初的URL并重定向到`crisis-center`路由:
首选的解决方案是添加一个`redirect`路由它会透明的把初始URL`''`)翻译成默认路径(`/crisis-center`)。
+makeExample('router/ts/app/crisis-center/crisis-center.routes.2.ts', 'redirect', 'app/crisis-center/crisis-center.routes.ts (redirect route)' )(format='.')
:marked
Since we only want to redirect when our path specifically matches `''`, we've added an extra configuration
to our route using `terminal: true`. Mainly for redirects, the `terminal` property tells the router
whether or not it should continue matching our URL against the rest of our defined routes.
A redirect route requires a `pathMatch` property to tell the router how to match a URL to the path of a route.
In this app, the router should select the route to `CrisisCenterComponent` when the *entire URL* matches `''`,
so we set the `pathMatch` value to `'full'`.
由于我们希望只有在路径明确的匹配到`''`时才重定向,所以我们往路由中添加了一个额外的配置项:`terminal: true`。
主要是为了重定向,`terminal`属性是用来控制路由器是否应该继续匹配URL和我们定义的路由。译者注`terminal`设置为`true`时,该路由的优先级别就低于其他路由,只有在所有其他路由都不匹配的时候才最后匹配这个路由。主要是为了标示专用于重定向的路由而设计的。)
@ -1918,7 +1913,14 @@ code-example(format="").
.l-sub-section
:marked
We'll discuss redirects further in a future update to this chapter.
The other possible `pathMatch` value is `'prefix'` which tells the router
to match the redirect route to _any_ URL that _begins_ with the redirect route's _prefix_ path.
That's not what we want in our use case. The `''` prefix path matches _every_ URL.
We should redirect to the `CrisisCenterComponent` _only_ when the _entire_ url is `''`
(or the equivalent `'/'`).
We'll discuss redirects in more detail in a future update to this chapter.
我们将在未来的更新中深入讨论重定向问题。

View File

@ -146,9 +146,10 @@ h2#create-and-configure 步骤1创建并配置项目
h3 (a) Create the project folder
h3 (a) 创建项目文件夹
- var _ = _docsFor == 'dart' ? '_' : '-';
code-example(language="sh").
mkdir angular2-quickstart
cd angular2-quickstart
mkdir angular2!{_}quickstart
cd angular2!{_}quickstart
h3#add-config-files (b) Add #{_package_and_config_files}
h3#add-config-files (b) 添加#{_package_and_config_filesCn}

View File

@ -11,7 +11,7 @@
a(
target="_blank"
href="http://angularjs.blogspot.com/2016/06/rc4-now-available.html"
) RC2 Now Available
) RC4 Now Available
p Today were happy to announce that we are shipping Angular 2.0.0-rc4. This release begins to lay the foundation for improved Angular Compilation, and makes improvements to testing....
.author
img(src="/resources/images/bios/stephenfluin.jpg")

View File

@ -1,6 +1,14 @@
{
"about": {
"title": "关于中文版",
"subtitle": "中文版的目标,译者的话,支持我们"
"title": "关于我们",
"subtitle": "关于译者及其友军的介绍,译者的感恩"
},
"follow": {
"title": "关注我们",
"subtitle": "Angular中文社区的官方公众号及其合作伙伴"
},
"home": {
"title": "官方中文版简介",
"subtitle": "Angular官方中文版的简介、致辞等"
}
}

View File

@ -1,27 +1,10 @@
.about-cn-translation
:marked
## 关于中文版
这是一份跟官方网站保持 **同步更新** 的中文版。虽然保持同步非常耗费精力,不过为了防止过时的内容误导读者,这份额外的付出还是很值得的。
我们全文采用意译的方式,在确保理解作者意思的前提下用中文重新表述,力求做到“信雅达”,当原文难以直译时更是如此。在必要时,我们会加“译注”来辅助读者阅读。
当然,即便如此,我们会错意的可能性也还是有的,所以我们的译稿都提供了中英文对照,如果你对某些语句有疑问,只要点一下,就可以显示对应的英文版内容,可自行对照理解。
对于英文词汇我们尽量采用业内成熟的译法以利于口头交流。对少部分在Angular之外比较罕见的专有名词我们会在译文中写成中英双语。
不过这部分还没有经过系统的梳理如果你发现哪里有问题请给我们提issue或Pull Request。
同时要注意我们只翻译“TypeScript”版的文档其它语言的版本大同小异可以在看懂TS版之后再对照看JS和Dart的英文版。不过我们还是建议你试用一下TypeScript。
本文档目前只完成了部分章节的初译,尚未完成审校和统稿,因此语言风格和表达等可能还有问题,欢迎到我们的<a href="https://github.com/angular/angular-cn" target="_blank">github</a>上提出issue或Pull Request。
本文档的任何更新都会实时发布于我们的 [首发网站](http://www.angular.live) 。如果你要进行转载请自行同步不过小心别DDoS了我们或者在想要同步到最新版时 [联系我们](mailto:traveller@163.com) 。
## 授权方式
本文档遵循[“保持署名—非商用”创意共享4.0许可证CC BY-NC 4.0](http://creativecommons.org/licenses/by-nc/4.0/deed.zh)授权方式,你不用知会我们就可以任意转载,但必须保持署名(特别是:不得去掉本页入口链接,也不得修改本页内容),并且不得用于商业目的。
## 关于译者
本文档有两位译者他们是多年的好友。这次利用业余时间联手翻译就是因为看好Angular 2的前景希望帮助大家在这项技术上能跟国外同步前进。
### 汪志成(雪狼)
《AngularJS深度剖析与最佳实践》的作者之一ThoughtWorks高级咨询师。他从1998年开始做商业软件开发拥有超过18年的从业经验至今仍热衷于编程。
《AngularJS深度剖析与最佳实践》的作者之一ThoughtWorks高级咨询师现任GDEGoogle开发者专家。崇尚“简单、专业、分享”。他从1998年开始做商业软件开发拥有超过18年的从业经验至今仍热衷于编程。
虽然一直在做编程工作,不过他最热衷的却是国学,特别是儒学与诗词。孟子曰:“得天下英才而教育之,三乐也”,愿践行之。
@ -30,14 +13,16 @@
### 叶志敏
早期翻译软件《东方快车》的产品经理至今已在英国留学和生活了十年。目前他正在用Angular 2与.net core开发一套针对英国医疗保健服务行业的ERP系统。
## 当前状态
目前:
- 除“API参考手册”之外的全部章节都已经完成了翻译和第一遍校对目前正在进行第二遍校对和内部评审。预计很快可以开始正式推出。
- “API参考手册”尚未开始翻译。同时由于技术限制它也不像其它文档那么容易翻译谁有什么好想法可以提出来。
- 由于技术限制“API小抄”尚无法进行同步翻译目前取的是rc.1版
- 官方仍在不断更新英文文档。我们通常会在一天内同步完毕;如果出现大量修改时,我们会争取在一周内同步完毕。
## 感恩
本中文网站能够达到现在的质量首先要感谢Angular开发组的项目经理Naomi的鼎力支持。她不但邀请我们加入了Angular项目组还让我们与各位文档作者之间建立了直接的沟通渠道这种沟通渠道非常宝贵让我们得以准确理解所涉及到的各个技术细节并减轻了保持同步更新时的额外工作量。
本网站能够及时推出要感谢Google中国区的负责人栾跃和与我们的接口人程路他们的专业性和高效率让我们得以心无旁骛的完成翻译工作。也是在他们的大力帮助下本网站才能最终作为官方中文版推出。
最后,要特别感谢我们各自的家人。同步、高质量的翻译是个耗时耗力的工作,如果没有她们的支持,此工作将无法完成。
## 支持我们
由于我们对翻译质量的极端要求所以很抱歉我们暂时无法接受新人加入翻译否则我们需要花费大量精力进行review。
但你可以在精神上支持我们,比如:
@ -58,3 +43,23 @@
- 另外还有一些做好事不留名的活雷锋
想让你的名字也出现在这里吗?请提供[反馈、纠错](https://github.com/angular/angular-cn/issues)。
## 我们的友军
此官网是由我和叶志敏为主翻译的并得到了鸣谢清单中各位网友的帮助但这只是Angular中文社区的冰山一角。
完整的Angular中文社区浩如烟海此处仅仅列举笔者所接触、合作过的一些重要人物
- **严清**
AngularJS中文社区的早期耕耘者也是AngularJS 1.x的早期传道者之一。虽然他已经不再使用AngularJS技术栈但其对社区的贡献和影响力不应忘记。
- **格茸扎西(破狼)**
AngularJS中文社区系列QQ群的群主从严清手里接下QQ群并长期维护。他还与译者之一的汪志成雪狼合著过一本书《AngularJS深度剖析与最佳实践》这本书的成功让我们看到了中文社区对Angular的热情支持最终激发了我们翻译Angular官网的行动。我们还共同开始了对国外新书ng-book2的翻译工作。
- **汤桂川**
广发证券的资深工程师Angular热情的布道者Angular 2的早期使用者之一他的团队还翻译过早期版本的开发指南。虽然交流不多不过可以感觉到他是个很Nice的人也带领着一个很有活力的团队。
如果你有自己的社区影响力,也欢迎[与我们接洽](mailto:asnowwolf@gmail.com),我们将给出热情的回应。

View File

@ -0,0 +1,17 @@
.about-cn-translation
:marked
## Angular中文社区官方微信
- (敬请期待)
## 友军QQ群
- 278252889AngularJS中文社区2000人已满
- 305739270AngularJS中文社区二群2000人
- 200242234Angular互助组
- 110455272Ionic开发实践
## 友军:微信号
- shuang_lang_shuo由破狼等人维护
- ThoughtWorks思特沃克软件技术有限公司

View File

@ -0,0 +1,69 @@
.about-cn-translation
:marked
## Angular开发组的致辞
.l-sub-section
:marked
**这是Angular开发组的项目经理TPMNaomi Black和工程总监Engineering DirectorBrad Green代表官方开发组发来的致辞这标志着angular.cn正式获得了官方身份。如文档中的其它地方一样点击任意中文即可显示原文。**
:marked
Welcome to angular.cn!
欢迎光临Angular中文官网
This official site and the developer guides you will find here are the result of hard work and dedication by members of Angular's Chinese developer community. More than just a linguistic translation, this site was localized and updated by developers who use and know Angular, and understand the concepts as engineers. Led by friends Zhicheng WANG (Ralph) and Zhimin YE (Rex), united by a commitment to open source software and helping developers, the [angular.cn team](./about.html) is motivated by the desire to make Angular more accessible to the millions of Chinese-speaking developers worldwide.
这份官方网站和《Angular 2 开发指南》的中文版是中国的Angular开发者社区共同努力奉献的成果。它们来自深谙Angular设计理念的工程师故此这份中文版不仅是语言上的简单汉化。出于对“开源精神”和“共享精神”的执着与推崇汪志成和叶志敏共同带领[angular.cn团队](./about.html)奋力工作力争让全世界的中文开发者与Angular实现零距离的亲密接触。
This Chinese version of angular.io is also the first official release of Angular's developer content in any language other than English!
除英文版之外,该中文版是第一个由官方正式发布的开发文档!
As a champion of open technology, Google has invested a lot and will continue to invest in the advancement of Angular, for the benefits of our users in China and around the world.
作为开源技术的倡导者Google已经并将继续投资于对Angular的完善和演进工作造福并回馈中国区的用户以及全世界的用户。
We are happy to see that Angulars Chinese developer community has grown to its current large size, fueled by not only the passion for technologies among developers, but also by the desire to make this technology effective for real businesses. Many companies in China have already built their businesses based on Angular technology. We hope that the updated materials on this official site will continue to inspire and help putting this technology into more real world business services and applications in China. If your business already runs on Angular, we invite you to join our [community](./follow.html) and become involved. We want to hear from you.
看到中国的Angular开发社区已经如此繁荣我们非常高兴。这不仅仅是出于开发者对技术的固有热情更是因为我们希望“用Angular高效实现商业需求”的宏伟愿景。事实上许多中国公司的业务早已基于Angular技术。我们希望通过对官网内容的持续更新鼓励并协助大家把Angular更多的应用于现实世界中的业务服务与应用程序。如果您的业务大厦已经构建在Angular的基础之上我们欢迎您加入[中文社区](./follow.html),期待听到您的心声!
Angular succeeds because it is built by and for developers who come from many different backgrounds. We hope that these materials will help you to learn and understand Angular, and to contribute back to the framework in future. We are excited to see what you will build with Angular here in China, and how the framework itself will change as the result of your enthusiasm.
Angular的成功是因为它由背景各异的开发者所创造它为开发者而生。我们希望这些文档能帮助大家学习和理解Angular总有一天大家还会为这个框架做出贡献。我们非常期待看到大家用各种方式应用Angular技术更希望看到Angular在所有开发者的热情支持下继续演进。
We also hope that through Angular.cn, you will discover more about the wide variety of web and mobile technologies from Google and the open source world, and how to leverage many Google platforms for your future business success.
通过angular.cn我们希望广大的开发者们能继续发掘更多来自Google和开源世界的Web技术和移动技术借助Google提供的平台登上业务成就的新高度。
We are happy to have you here. Welcome.
非常高兴在这里遇见你们。Google欢迎你
Naomi Black and Brad Green
Naomi Black与Brad Green
## 栾跃的致辞及Google中国区简介
(敬请期待)
## 关于中文版
这是一份跟官方网站保持 **同步更新** 的中文版。虽然保持同步非常耗费精力,不过为了防止过时的内容误导读者,这份额外的付出还是很值得的。
我们全文采用意译的方式,在确保理解作者意思的前提下用中文重新表述,力求做到“信雅达”,当原文难以直译时更是如此。在必要时,我们会加“译注”来辅助读者阅读。
当然,即便如此,我们会错意的可能性也还是有的,所以我们的译稿都提供了中英文对照,如果你对某些语句有疑问,只要点一下它,就可以显示对应的英文版内容,读者可自行对照理解。
对于英文词汇我们尽量采用业内成熟的译法以利于口头交流。对少部分在Angular之外比较罕见的专有名词我们会在译文中写成中英双语。
这部分做了初步的梳理,但是仍可能有遗漏,如果你发现哪里有问题,请到我们的<a href="https://github.com/angular/angular-cn" target="_blank">github</a>上提出issue或Pull Request。
同时要注意我们只翻译“TypeScript”版的文档其它语言的版本大同小异可以在看懂TS版之后再对照看JS和Dart的英文版。不过我们还是建议你试用一下TypeScript。
## 授权方式
本文档遵循[“保持署名—非商用”创意共享4.0许可证CC BY-NC 4.0](http://creativecommons.org/licenses/by-nc/4.0/deed.zh)授权方式,你不用知会我们就可以转载,但必须保持署名(特别是:不得去掉本页入口链接,也不得修改本页内容),并且不得用于商业目的。如果需要进行任何商业推广,请接洽我们的[联系人程路](mailto:lucheng@google.com)。
本文档首发于[Angular中文网](https://angular.cn/)。如果你要进行转载请自行同步不过小心别DDoS了我们。
## 工作预告
我们已经组织了一个九人专家组开始了对ng-book2的翻译工作出版社也加快了流程争取能尽早与各位见面以我们一向的质量标准我敢保证这会是一份精品。同时我们也和Google中国的DevRel部门加强了合作未来还会有一系列线上和线下推广工作如果您有意为这些活动贡献力量请接洽我们的[联系人程路](mailto:lucheng@google.com)。