Skip to content

Commit

Permalink
Merge pull request #71 from yanni4night/master
Browse files Browse the repository at this point in the history
Fixed #69,修正一系列笔误、翻译不恰当、排版和标点问题
  • Loading branch information
towerhe committed Dec 5, 2014
2 parents 4b30f9c + a4ca5be commit 7fe19ed
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ build/
*.swp
.rvmrc
vendor/bundle
.cache
2 changes: 1 addition & 1 deletion source/bilingual_guides/concepts/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ superior shareability and collaboration. Today, most JavaScript
frameworks treat the URL as an afterthought, instead of the primary
reason for the web's success.

相反,**Web应用是通过能收藏和分析链接来凸显它的作用的**。URL是Web应用的一个最核心的特性,正是URL使得Web应用有了卓越的可共享性和可协作性。现今,很多Javascript框架都是时候才考虑URL,没有考虑这个让Web成功的主要因素。
相反,**Web应用是通过能收藏和分析链接来凸显它的作用的**。URL是Web应用的一个最核心的特性,正是URL使得Web应用有了卓越的可共享性和可协作性。现今,很多Javascript框架都事后才考虑URL,没有考虑这个让Web成功的主要因素。

Ember.js, therefore, marries the tools and concepts of native
GUI frameworks with support for the feature that makes the web so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ App.todosController.get('remaining');
Note that `@each` only works one level deep. You cannot use nested forms
like `[email protected]` or `[email protected][email protected]`.

注意`@each`只工作在第一级。不能嵌套使用,如:`todos.@ech.owner.name`或者`[email protected][email protected]`
注意`@each`只工作在第一级。不能嵌套使用,如:`todos.@each.owner.name`或者`[email protected][email protected]`
2 changes: 1 addition & 1 deletion source/bilingual_guides/templates/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ triggering a method directly on the controller, it is strongly recommended that
you put your action handling methods inside an `actions` hash for forward
compatibility.

路由和控制器处理操作**必须将操作处理函数定义在`actions`哈希中**。即便一个路由有一个与操作同名的的方法,如果不定义在`ations`哈希中也不会被触发。对于一个控制器,强烈推荐将操作处理函数定义在`actions`哈希中来保证向前兼容。
路由和控制器处理操作**必须将操作处理函数定义在`actions`哈希中**。即便一个路由有一个与操作同名的的方法,如果不定义在`actions`哈希中也不会被触发。对于一个控制器,强烈推荐将操作处理函数定义在`actions`哈希中来保证向前兼容。

```js
App.PostRoute = Ember.Route.extend({
Expand Down
21 changes: 9 additions & 12 deletions source/bilingual_guides/templates/handlebars-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ regular HTML, but also give you the ability to embed expressions that
change what is displayed.

`Ember.js` 使用 [Handlebars模板库](http://www.handlebarsjs.com)
来增强你的应用程序的用户界面。`Handlebars`模板与普通的HTML类似,但是它还提供了嵌入
改变显示内容的表达式的功能。
来增强你的应用程序的用户界面。`Handlebars`模板与普通的HTML类似,但是它还提供 了嵌入表达式来改变显示内容的功能。

We take Handlebars and extend it with many powerful features. It may
help to think of your Handlebars templates as an HTML-like DSL for
describing the user interface of your app. And, once you've told
Ember.js to render a given template on the screen, you don't need to
write any additional code to make sure it keeps up-to-date.

我们采用了`Handlebars`,并且还使用许多强大的功能对其进行了扩展。为了有助于理解,你可以认为`Handlebars`模板是一种用于描述你的应用程序界面的类HTML的DSL。而且,一旦使用`Ember.js`在屏幕上渲染一个
模板,开发人员就不需要编写额外的代码来确保其更新。
我们采用了`Handlebars`,并且还使用许多强大的功能对其进行了扩展。为了有助于理解,你可以认为`Handlebars`模板是一种用于描述你的应用程序界面的类HTML的DSL。而且,一旦使用`Ember.js`在屏幕上渲染一个模板,开发人员就不需要编写额外的代码来确保其更新。

If you'd prefer an indentation-based alternative to Handlebars syntax,
try [Emblem.js](http://www.emblemjs.com), but make sure you're comfortable
Expand All @@ -32,7 +30,7 @@ with Handlebars first!
If you're not using build tools, you can define your application's main
template inside your HTML by putting it inside a `<script>` tag, like so:

如果你没有在使用构建工具,你仍然可以在HTML文档中定义应用程序的主模板,只需要在HTML中加上`<script>`标签,如下所示:
如果你没有在使用构建工具你仍然可以在HTML文档中定义应用程序的主模板,只需要在HTML中加上`<script>`标签如下所示:

```html
<html>
Expand All @@ -48,15 +46,15 @@ This template will be compiled automatically and become your
[application template](/guides/templates/the-application-template),
which will be displayed on the page when your app loads.

这个模板将会被自动编译成为你的应用程序的主模板,它将在应用程序加载时通过路由显示在页面上。
这个模板将会被自动编译成为你的应用程序的主模板它将在应用程序加载时通过路由显示在页面上。

You can also define templates by name that can be used later. For
example, you may want to define a reusable control that is used in many
different places in your user interface. To tell Ember.js to save the
template for later, instead of displaying it immediately, you can add
the `data-template-name` attribute:

你也可以为模板定义一个名称,以便复用。例如,你可能想定义一个在多个不同的应用程序用户界面处都可以使用的可重用控件。
你也可以为模板定义一个名称以便复用。例如你可能想定义一个在多个不同的应用程序用户界面处都可以使用的可重用控件。
如果只是希望`Ember.js`先保存模板留做复用,而不是即时显示,那么可以使用`data-template-name`属性:

```html
Expand Down Expand Up @@ -85,7 +83,7 @@ finds the properties that it displays.
You can display a property from your controller by wrapping the property
name in curly braces, like this:

使用花括号将属性名称括起来,就可以显示控制器中所定义的属性,如下所示:
使用花括号将属性名称括起来,就可以显示控制器中所定义的属性如下所示:

```handlebars
Hello, <strong>{{firstName}} {{lastName}}</strong>!
Expand All @@ -95,7 +93,7 @@ This would look up the `firstName` and `lastName` properties from the
controller, insert them into the HTML described in the template, then
put them into the DOM.

上面的语句将会到控制器中查询`firstName``lastName`属性值,插入到模板所描述的HTML文档中,然后放到`DOM`中去。
上面的语句将会到控制器中查询`firstName``lastName` 属性值,插入到模板所描述的HTML文档中,然后放到`DOM`中去。

By default, your top-most application template is bound to your `ApplicationController`:

Expand All @@ -111,7 +109,7 @@ App.ApplicationController = Ember.Controller.extend({
The above template and controller would combine to display the following
rendered HTML:

上面的模板和控制器将协作呈现出被渲染的HTML,如下所示:
上面的模板和控制器将协作呈现出被渲染的HTML如下所示:

```html
Hello, <strong>Trek Glowacki</strong>!
Expand All @@ -121,8 +119,7 @@ These expressions (and the other Handlebars features you will learn
about next) are _bindings aware_. That means that if the values used
by your templates ever change, your HTML will be updated automatically.

这些表达式 (以及接下来你将了解的其他`Handlerbars`功能)
都有绑定机制。这意味着HTML文档将随着模板使用的属性值的改变而自动更新。
这些表达式 (以及接下来你将了解的其他`Handlerbars`功能)都有绑定机制。这意味着HTML文档将随着模板使用的属性值的改变而自动更新。

As your application grows in size, it will have many templates, each
bound to different controllers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ direct, programmatic control of a view's children. In that case, you can
use `Ember.ContainerView`, which explicitly exposes a public API for
doing so.

虽然模板可以处理大部分情形,但是偶尔也会需要直接通过编程来控制视图的子。在这种情况下,可以使用`Ember.ContainerView`,它显式的暴露了一个公有API来完成这项任务。
虽然模板可以处理大部分情形,但是偶尔也会需要直接通过编程来控制视图的子元素。在这种情况下,可以使用`Ember.ContainerView`,它显式的暴露了一个公有API来完成这项任务。

### Container Views

Expand Down
2 changes: 1 addition & 1 deletion source/guides/concepts/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Ember.js的设计目标是能帮助广大开发者构建能与本地应用相颦

然而,记住Web的特殊性非常重要。很多人认为一个应用是Web应用是因为其使用了像HTML、CSS和Javascript这些技术。实际上,这只是实现的细节问题。

相反,**Web应用是通过能收藏和分享链接来凸显它的作用的**。URL是Web应用的一个最核心的特性,正是URL使得Web应用有了卓越的可共享性和可协作性。现今,很多Javascript框架都是时候才考虑URL,没有考虑这个让Web成功的主要因素。
相反,**Web应用是通过能收藏和分享链接来凸显它的作用的**。URL是Web应用的一个最核心的特性,正是URL使得Web应用有了卓越的可共享性和可协作性。现今,很多Javascript框架都事后才考虑URL,没有考虑这个让Web成功的主要因素。

Ember.js将本地GUI框架中的工具和概念与使得Web应用如此强大的URL嫁接在一起。

Expand Down
10 changes: 4 additions & 6 deletions source/guides/object-model/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ App.husband = Ember.Object.create({

App.husband.get('householdIncome'); // 80000

// Someone gets raise.
// 有人涨薪了。
App.husband.set('householdIncome', 90000);
App.wife.get('householdIncome'); // 90000
```
Expand All @@ -35,13 +35,11 @@ App.userView = Ember.View.create({
userNameBinding: Ember.Binding.oneWay('App.user.fullName')
});

// Changing the name of the user object changes
// the value on the view.
// 改变 user 对象的 name 属性同时也改变了视图的值。
App.user.set('fullName', "Krang Gates");
// App.userView.userName will become "Krang Gates"
// App.userView.userName 会变成 "Krang Gates"

// ...but changes to the view don't make it back to
// the object.
// ...但是对视图的改变将不会反应到对象中。
App.userView.set('userName', "Truckasaurus Gates");
App.user.get('fullName'); // "Krang Gates"
```
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ App.todosController.get('remaining');
// 1
```

注意`@each`只工作在第一级。不能嵌套使用,如:`todos.@ech.owner.name`或者`[email protected][email protected]`
注意`@each`只工作在第一级。不能嵌套使用,如:`todos.@each.owner.name`或者`[email protected][email protected]`
6 changes: 3 additions & 3 deletions source/guides/object-model/observers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
英文原文:[http://emberjs.com/guides/object-model/observers/](http://emberjs.com/guides/object-model/observers/)

Ember 为包括计算后属性在内的任意一种属性提供了观察器。可以通过使用 `addObserver` 方法来为一个对象设置一个观察器
Ember 为包括计算后属性在内的任意一种属性提供了观察器。可以通过使用 `addObserver` 方法来为一个对象设置一个观察器

```javascript
Person = Ember.Object.extend({
Expand Down Expand Up @@ -50,7 +50,7 @@ Person.reopen({
```javascript
Person.reopen({
partOfNameChanged: function() {
// 因为firstName 和 lastName 都被设置了,将触发两次更新
// 因为 firstName 和 lastName 都被设置了,将触发两次更新
}.observes('firstName', 'lastName')
});

Expand Down Expand Up @@ -89,7 +89,7 @@ App.Person = Ember.Object.extend({
},

salutationDidChange: function() {
// some side effect of salutation changing
// 一些 salutation 的负效应正在改变
}.observes('salutation').on('init')
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Person.create().get('isPerson') // true

```javascript
Person.reopen({
// override `say` to add an ! at the end
// 在末尾加 ! 来重载 `say`
say: function(thing) {
this._super(thing + "!");
}
Expand Down
2 changes: 1 addition & 1 deletion source/guides/templates/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ App.PostController = Ember.ObjectController.extend({

如果控制器没有实现一个与操作的同名方法,那么这个操作将被发送至路由,这样当前处于激活状态的叶节点路由可以处理该操作。

路由和控制器处理操作**必须将操作处理函数定义在`actions`哈希中**。即便一个路由有一个与操作同名的的方法,如果不定义在`ations`哈希中也不会被触发。对于一个控制器,强烈推荐将操作处理函数定义在`actions`哈希中来保证向前兼容。
路由和控制器处理操作**必须将操作处理函数定义在`actions`哈希中**。即便一个路由有一个与操作同名的的方法,如果不定义在`actions`哈希中也不会被触发。对于一个控制器,强烈推荐将操作处理函数定义在`actions`哈希中来保证向前兼容。

```js
App.PostRoute = Ember.Route.extend({
Expand Down
8 changes: 3 additions & 5 deletions source/guides/templates/handlebars-basics.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
英文原文:[http://emberjs.com/guides/templates/handlebars-basics/](http://emberjs.com/guides/templates/handlebars-basics/)

`Ember.js` 使用 [Handlebars模板库](http://www.handlebarsjs.com)
来增强你的应用程序的用户界面。`Handlebars`模板与普通的HTML类似,但是它还提供了嵌入
改变显示内容的表达式的功能。
来增强你的应用程序的用户界面。`Handlebars`模板与普通的HTML类似,但是它还提供了嵌入表达式来改变显示内容的功能。

我们采用了`Handlebars`,并且还使用许多强大的功能对其进行了扩展。为了有助于理解,你可以认为`Handlebars`模板是一种用于描述你的应用程序界面的类HTML的DSL。而且,一旦使用`Ember.js`在屏幕上渲染一个
模板,开发人员就不需要编写额外的代码来确保其更新。
我们采用了`Handlebars`,并且还使用许多强大的功能对其进行了扩展。为了有助于理解,你可以认为`Handlebars`模板是一种用于描述你的应用程序界面的类HTML的DSL。而且,一旦使用`Ember.js`在屏幕上渲染一个模板,开发人员就不需要编写额外的代码来确保其更新。

在熟悉了`Handlebars`之后,如果相对`Handlebars`语法而言,你更加习惯基于缩进的写法,那么可以试试使用[Emblem.js](http://www.emblemjs.com)

Expand All @@ -25,7 +23,7 @@

这个模板将会被自动编译成为你的应用程序的主模板,它将在应用程序加载时通过路由显示在页面上。

你也可以为模板定义一个名称,以便复用。例如,你可能想定义一个在多个不同的应用程序用户界面处都可以使用的可重用控件。
你也可以为模板定义一个名称以便复用。例如你可能想定义一个在多个不同的应用程序用户界面处都可以使用的可重用控件。
如果只是希望`Ember.js`先保存模板留做复用,而不是即时显示,那么可以使用`data-template-name`属性:

```html
Expand Down
2 changes: 1 addition & 1 deletion source/guides/understanding-ember/the-view-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ App = Ember.Application.create({

由于存在不明确的地方,所以创建视图层级的唯一方法便是使用模板的`{{view}}`助手,它将永远可以将视图插入到与任何纯文本关联的正确位置。

虽然模板可以处理大部分情形,但是偶尔也会需要直接通过编程来控制视图的子。在这种情况下,可以使用`Ember.ContainerView`,它显式的暴露了一个公有API来完成这项任务。
虽然模板可以处理大部分情形,但是偶尔也会需要直接通过编程来控制视图的子元素。在这种情况下,可以使用`Ember.ContainerView`,它显式的暴露了一个公有API来完成这项任务。

### 容器视图

Expand Down

0 comments on commit 7fe19ed

Please sign in to comment.