Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Translate the introduction of Model module #17

wants to merge 3 commits into from

2 participants


No description provided.








@zernel zernel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2013
  1. @zernel
  2. @zernel

    Translation of defining-a-store

    zernel authored
  3. @zernel

    Add the link of original

    zernel authored
This page is out of date. Refresh to see the latest.
6 data/guides.yml
@@ -80,10 +80,10 @@ Controllers:
- title: "Managing Dependencies Between Controllers"
url: "controllers/dependencies-between-controllers"
- - title: "Introduction"
+ - title: "介绍"
url: "models"
- - title: "Defining a Store"
+ - title: "创建一个存储器"
url: "models/defining-a-store"
- title: "Defining Models"
url: "models/defining-models"
14 source/guides/models/
@@ -1,14 +1,21 @@
-## Defining a Store
+## 创建一个存储器(Defining a Store)
Every application using Ember Data has a store. The store is the
repository that holds loaded models, and is responsible for retrieving
models that have not yet been loaded.
+每一个使用 Ember Data 的应用都会有一个存储器。这个存储器会成为已加载模型的贮存器,并且检索还未被加载的模型。
Typically, you will interact with models directly, not the store.
However, you do need to tell Ember.js that you want Ember Data to manage
your models. To do so, simply define a subclass of `DS.Store` on your
+通常,你可以直接跟模型交互,而不使用存储器。但是你需要让 Ember.js 知道你现在在使用 Ember Data 来管理你的模型。
App.Store = DS.Store.extend({
revision: 12
@@ -20,12 +27,17 @@ number, and is used by Ember Data to notify you of breaking changes to
the public API. This will be removed once Ember Data reaches 1.0. See
the [Breaking Changes document][1] for more information.
+注意这里的`revision`属性,它是 API 的修订版本号,在Ember Data 1.0 版本之前用来提醒你公共 API 的重大更改。
+查看[Breaking Changes 文档][1]以获取更多信息。
If you want to customize the store, you can do so when creating the
subclass. For example, if you wanted to use an adapter other than the
default `DS.RESTAdapter`, you would do so like this:
App.Store = DS.Store.extend({
revision: 12,
17 source/guides/models/
@@ -1,27 +1,42 @@
-## Models
+## 模型(Models)
In most Ember.js apps, models are handled by [Ember Data][1]. Ember Data
is a library, built with and for Ember.js, designed to make it easy to
retrieve records from a server, make changes in the browser, then save
those changes back to the server.
+在大部分的 Ember.js 应用里,模型是通过 [Ember Data][1] 来处理的。Ember
+Data 是一个由 Ember.js 写的库,它使我们可以很方便从服务器端取回记录并动态改变浏览器中的内容,然后保存这些更改回服务器。
It provides many of the facilities you'd find in server-side ORMs like
ActiveRecord, but is designed specifically for the unique environment of
JavaScript in the browser.
+你可以在服务器端找到像 ActiveRecord 这样的 ORM,不过它提供了专门为浏览器端的 Javascript 环境设计的工具方法。
Without any configuration, Ember Data can load and save records and
relationships served via a RESTful JSON API, provided it follows certain
+Ember Data 并不需要任务配置就可以通过 RESTful JSON API 的惯例来加载和保存记录和关系。
We also understand that there exist many web service APIs in the world,
many of them crazy, inconsistent, and out of your control. Ember Data is
designed to be configurable to work with whatever persistence layer you
want, from the ordinary to the exotic.
+Ember Data 被设计成可配置的,无论你想要怎么样的持久层它都可以满足。
Currently, Ember Data ships as a separate library from Ember.js, while
we expand the adapter API to support more features. The API described in
this section tends to be stable, however. Until Ember Data is included
as part of the standard distribution, you can get your copy from the
[GitHub page][1].
+目前,当我们需要扩展适配器的 API 来支持更多的功能时,Ember Data 会作为 Ember.js 一个独立的库。
+但是本节中提到的 API 已经趋于稳定。直到 Ember Data 作为标准配置的一部分,你可以从[GitHub page][1]获取它的副本。
Something went wrong with that request. Please try again.