Skip to content

Commit 0a40a0e

Browse files
removed {{page.lang}} from inside include templates
1 parent 478659b commit 0a40a0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+184
-117
lines changed

_data/sidebars/zh_lb2_sidebar.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
## top level property=================
88
# entries: [ menuitem ]
99

10+
1011
title: Loopback 2.0
1112
url: /doc/zh/lb2/index.html
12-
folders:
13-
14-
- title: LoopBack
15-
url: '/doc/zh/lb2/LoopBack.html'
16-
output: 'web, pdf'
17-
children:
13+
children:
1814

1915
- title: '安装 StrongLoop'
2016
url: '/doc/zh/lb2/6095101.html'

images/6258767.png

168 KB
Loading

images/6258769.png

92.3 KB
Loading

images/6258771.png

43.5 KB
Loading

images/6258772.png

97.7 KB
Loading

images/6258774.png

56.8 KB
Loading

images/6258775.png

58 KB
Loading

images/6258781.png

56.7 KB
Loading

images/6258782.png

84 KB
Loading

images/6258783.png

161 KB
Loading

images/6258809.png

192 KB
Loading

images/6258810.png

7.21 KB
Loading

images/6258811.png

13.7 KB
Loading

images/6258812.png

66.5 KB
Loading

images/6258813.png

27.1 KB
Loading

images/6258814.png

24.9 KB
Loading

pages/zh/lb2/6094913.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ See also the [LoopBack iOS SDK API](http://apidocs.strongloop.com/loopback-ios/a
1313

1414
## Overview
1515

16-
The LoopBack iOS SDK eliminates the need to use the clunky `NSURLRequest` and similar interfaces to interact with a LoopBack-based backend. Instead, interact with your models and data sources in a comfortable, first-class, native manner.
16+
The LoopBack iOS SDK eliminates the need to use the clunky `NSURLRequest` and similar interfaces to interact with a LoopBack-based backend.
17+
Instead, interact with your models and data sources in a comfortable, first-class, native manner.
1718

1819
### Prerequisites
1920

@@ -25,7 +26,10 @@ The LoopBack iOS SDK eliminates the need to use the clunky `NSURLRequest` and
2526

2627
## The LoopBack iOS guide app
2728

28-
The easiest way to get started with the LoopBack iOS SDK is with the LoopBack iOS guide app. The guide app comes ready to compile with XCode, and each tab in the app guides you through the features available to mobile apps through the SDK.  Here are some representative screenshots:
29+
The easiest way to get started with the LoopBack iOS SDK is with the LoopBack iOS guide app.
30+
The guide app comes ready to compile with XCode, and each tab in the app guides you through the features available to mobile apps through the SDK.
31+
32+
Here are some representative screenshots:
2933

3034
{% include image.html file="9830431.png" alt="" %}
3135
{% include image.html file="9830430.png" alt="" %}
@@ -44,11 +48,13 @@ From your usual projects directory:
4448
$ open LoopBackGuideApplication.xcodeproj
4549
```
4650
47-
3. Run the application from Xcode (Command+R by default) and follow the instructions on each tab. Popup dialogs in the application will ask you to uncomment various code blocks in each ViewController illustrating how to use the LoopBack SDK to interact with models stored on the server.
51+
3. Run the application from Xcode (Command+R by default) and follow the instructions on each tab.
52+
Popup dialogs in the application will ask you to uncomment various code blocks in each ViewController illustrating how to use the LoopBack SDK to interact with models stored on the server.
4853
4954
## Getting Started with the iOS SDK
5055
51-
If you are creating a new iOS application or want to integrate an existing application with LoopBack, use the LoopBack SDK directly (LoopBack.framework), independent of the guide application.
56+
If you are creating a new iOS application or want to integrate an existing application with LoopBack, use the LoopBack SDK directly (LoopBack.framework),
57+
independent of the guide application.
5258
5359
Follow these steps:
5460
@@ -59,12 +65,11 @@ Follow these steps:
5965
Important:Make sure to select "Copy items into destination group's folder". This places a copy of the SDK within your application's project folder.
6066
{% include image.html file="9830433.png" alt="" %} 
6167
62-
3. Verify LoopBack is included in the list of iOS Frameworks to link against your binary. In your Project settings, check the 'Link with Binaries' section under the 'Build Phases' tab. If it's missing, add it directly by clicking the '+' button and selecting LoopBack.framework.
68+
3. Verify LoopBack is included in the list of iOS Frameworks to link against your binary.
69+
In your Project settings, check the 'Link with Binaries' section under the 'Build Phases' tab. If it's missing, add it directly by clicking the '+' button and selecting LoopBack.framework.
6370
6471
{% include important.html content="
65-
6672
If **LoopBack.framework** isn't displayed in the list, try the previous step again; Xcode didn't create the copy it was supposed to create.
67-
6873
" %}
6974
7075
{% include image.html file="9830432.png" alt="" %}
@@ -79,9 +84,10 @@ Follow these steps:
7984
8085
This `LBRESTAdapter` provides the starting point for all our interactions with the running and anxiously waiting server.
8186
82-
Once we have access to `adapter` (for the sake of example, we'll assume the Adapter is available through our AppDelegate), we can create basic `LBModel` and `LBModelRepository` objects. Assuming we've previously created a model named "product": 
87+
Once we have access to `adapter` (for the sake of example, we'll assume the Adapter is available through our AppDelegate), we can create basic `LBModel` and `LBModelRepository` objects.
88+
Assuming we've previously created a model named "product": 
8389
84-
```js
90+
```
8591
LBRESTAdapter * adapter = [
8692
[UIApplication sharedApplication] delegate
8793
].adapter;
@@ -142,9 +148,8 @@ var Widget = app.model('widget', {
142148
Because of this the repository class name (`'widget'`, above) needs to match the name that model was given on the server. 
143149

144150
{% include warning.html content="
145-
146-
If you haven't created a model yet, see [Defining models](/doc/{{page.lang}}/lb2/Defining-models.html). The model _must_ exist (even if the schema is empty) before your app can interact with it.
147-
151+
If you haven't created a model yet, see [Defining models](/doc/zh/lb2/Defining-models.html).
152+
The model _must_ exist (even if the schema is empty) before your app can interact with it.
148153
" %}
149154

150155
Use this to make creating Models easier. Match the name or create your own.

pages/zh/lb2/6094931.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Follow this tutorial to create a web application ([loopback-example-relation](ht
1515

1616
Begin by scaffolding the application with [`slc loopback`](https://docs.strongloop.com/display/NODE/slc+loopback):
1717

18-
`$ slc loopback`
18+
```shell
19+
$ slc loopback
20+
```
1921

2022
You'll see:
2123

@@ -30,7 +32,7 @@ Enter **loopback-example-relation** as the project name (referred to as the _
3032

3133
You'll use an in-memory database to hold data. [Create a model](/doc/{{page.lang}}/lb2/Creating-models.html) named `Customer` as follows:
3234

33-
```
35+
```shell
3436
$ cd loopback-example-relation
3537
$ slc loopback:model Customer
3638
```
@@ -81,7 +83,9 @@ You'll see new files `customer.json`, `order.json`, and `review.json` in `/commo
8183

8284
Now create a front-end to make it easier to analyze the data.  Install [Embedded JavaScript (EJS)](http://embeddedjs.com/), by running the following command from the project root:
8385

84-
`$ npm install --save ejs`
86+
```shell
87+
$ npm install --save ejs
88+
```
8589

8690
Then configure the application [view engine](http://expressjs.com/api) by modifying `server/server.js` as follows:
8791

@@ -109,7 +113,9 @@ module.exports = function(server) {
109113

110114
Finally, create the `views` directory by running:
111115

112-
`$ mkdir -p server/views`
116+
```shell
117+
$ mkdir -p server/views
118+
```
113119

114120
Inside the `views` directory, create `index.html` with the following contents:
115121

@@ -146,7 +152,7 @@ Inside the `views` directory, create `index.html` with the following content
146152

147153
View what you have so far by entering this command:
148154

149-
```
155+
```shell
150156
$ cd loopback-example-relation
151157
$ slc run server
152158
```
@@ -214,9 +220,10 @@ module.exports = function(server) {
214220
Create two more scripts, [create-reviews.js](https://github.com/strongloop/loopback-example-datagraph/blob/master/server/boot/create-reviews.js) and [create-orders.js](https://github.com/strongloop/loopback-example-datagraph/blob/master/server/boot/create-orders.js) in `server/boot`. This sample data will be automatically loaded when you start the application.
215221

216222
{% include warning.html content="
217-
218-
`automigrate()` recreates the database table/index if it already exists. In other words, existing tables will be dropped and ALL EXISTING DATA WILL BE LOST. For more information, see [Creating a database schema from models](/doc/{{page.lang}}/lb2/Creating-a-database-schema-from-models.html). Note also that `Model.scope()` is only in `create-customers.js`.
219-
223+
`automigrate()` recreates the database table/index if it already exists.
224+
In other words, existing tables will be dropped and ALL EXISTING DATA WILL BE LOST.
225+
For more information, see [Creating a database schema from models](/doc/zh/lb2/Creating-a-database-schema-from-models.html).
226+
Note also that `Model.scope()` is only in `create-customers.js`.
220227
" %}
221228

222229
## Create model relations
@@ -230,7 +237,9 @@ You're going to create four relations between the models you just created.  The
230237

231238
From the project root, enter the command:
232239

233-
`$ slc loopback:relation`
240+
```shell
241+
$ slc loopback:relation
242+
```
234243

235244
Follow the prompts and create the following relationships:
236245

@@ -252,9 +261,8 @@ Review - _belongsTo_ Customer
252261
Order - _belongsTo_ Customer
253262

254263
{% include important.html content="
255-
256-
For any item without _property name for the relation_ or _custom foreign key_, just use the defaults. LoopBack will [derive](/doc/{{page.lang}}/lb2/BelongsTo-relations.html) these values automatically when you don't specify one.
257-
264+
For any item without _property name for the relation_ or _custom foreign key_, just use the defaults.
265+
LoopBack will [derive](/doc/zh/lb2/BelongsTo-relations.html) these values automatically when you don't specify one.
258266
" %}
259267

260268
When you're done, your `common/models/customer.json` should look like:

pages/zh/lb2/6095006.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ summary:
1313

1414
**Prerequisites**: 请先阅读以下教程
1515

16-
* [安装 StrongLoop](/doc/{{page.lang}}/lb2/6095101.html).
17-
* 阅读[LoopBack 核心概念](/doc/{{page.lang}}/lb2/6095111.html).
16+
* [安装 StrongLoop](/doc/zh/lb2/6095101.html).
17+
* 阅读[LoopBack 核心概念](/doc/zh/lb2/6095111.html).
1818

1919
" %}
2020

pages/zh/lb2/6095008.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ LoopBack enables you to easily persist your data model to a variety of data sour
2222
You're going to take the app from the previous section and connect it to MySQL.   
2323

2424
{% include note.html content="
25-
26-
If you followed the previous steps in the tutorial, go to [Add a data source](/doc/{{page.lang}}/lb2/6095008.html).
25+
If you followed the previous steps in the tutorial, go to [Add a data source](/doc/zh/lb2/6095008.html).
2726

2827
If you're just jumping in, follow the steps below to catch up...
29-
3028
" %}
3129

3230
Get the app (in the state following the last article) from GitHub and install all its dependencies:
@@ -93,9 +91,13 @@ Now add the loopback-connector-mysql module and install the dependencies:
9391

9492
{% include important.html content="
9593

96-
If you have a MySQL database server that you can use, please use it. Create a new database called \"demo.\" If you wish, uou can use a different database name. Just make sure the `mysqlDs.database` property in `datasources.json `matches it (see below).
94+
If you have a MySQL database server that you can use, please use it. Create a new database called \"demo\".
95+
If you wish, uou can use a different database name. Just make sure the `mysqlDs.database` property in `datasources.json `matches it (see below).
9796

98-
If not, you can use the StrongLoop MySQL server running on [demo.strongloop.com](http://demo.strongloop.com/). However, be aware that it is a shared resource. There is a small chance that two users may run the script that creates sample data (see [Add some test data and view it](/doc/{{page.lang}}/lb2/6095008.html), below) at the same time and may run into race condition. For this reason, we recommend you use your own MySQL server if you have one.
97+
If not, you can use the StrongLoop MySQL server running on [demo.strongloop.com](http://demo.strongloop.com/).
98+
However, be aware that it is a shared resource.
99+
There is a small chance that two users may run the script that creates sample data (see [Add some test data and view it](/doc/zh/lb2/6095008.html), below)
100+
at the same time and may run into race condition. For this reason, we recommend you use your own MySQL server if you have one.
99101

100102
" %}
101103

@@ -158,7 +160,9 @@ The `loopback-getting-started` module contains the `create-sample-models.js`
158160

159161
{% include note.html content="
160162

161-
The auto-migration script below is an example of a _boot script_ that LoopBack executes when an application initially starts up. Use boot scripts for initialization and to perform any other logic your application needs to perform when it starts. See [定义启动脚本(boot script)](/doc/{{page.lang}}/lb2/6095038.html) for more information.
163+
The auto-migration script below is an example of a _boot script_ that LoopBack executes when an application initially starts up.
164+
Use boot scripts for initialization and to perform any other logic your application needs to perform when it starts.
165+
See [定义启动脚本(boot script)](/doc/zh/lb2/6095038.html) for more information.
162166

163167
" %}
164168

pages/zh/lb2/6095009.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LoopBack 应用自带API浏览器,可以帮助你在开发时方便地测试
2323

2424
{% include note.html content="
2525

26-
如果你一步一步学习这个教程,那么就跳过以下关于运行应用程序的内容,直接跳到[运行 API 浏览器](/doc/{{page.lang}}/lb2/6095009.html).
26+
如果你一步一步学习这个教程,那么就跳过以下关于运行应用程序的内容,直接跳到[运行 API 浏览器](/doc/zh/lb2/6095009.html).
2727

2828
如果你是半途中阅读本章节,请先根据以下步骤获得教程中的内容
2929

@@ -46,7 +46,7 @@ $ npm install
4646

4747
在浏览器中输入 [http://localhost:3000/explorer](http://localhost:3000/explorer)。你可以看到现在你的应用中包含两个模型 - **Users** 和 **CoffeeShops:** 
4848

49-
{% include image.html file="5570638.png" alt="" %}
49+
{% include image.html file="6258784.png" alt="" %}
5050

5151
除了我们定义的CoffeeShop模型,默认情况下,Loopback会为每个应用程序生成User模型及相对应的REST API。
5252

pages/zh/lb2/6095030.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ If you want to use the sample Android client app, download the  [Push Notifica
183183
184184
It may take several minutes to launch your application and the Android virtual device the first time.
185185
186-
" %}{% include warning.html content="
186+
" %}
187+
188+
{% include warning.html content="
187189
188190
Due to a [known issue with Google Play Services](https://code.google.com/p/android/issues/detail?id=61675), you must download and import an older version of Google Play services.
189191

pages/zh/lb2/6095038.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ boot(app, __dirname);
4949

5050
{% include note.html content="
5151

52-
如果你是使用slc loopback创建应用的, [Application generator](/doc/{{page.lang}}/lb2/Application-generator.html),那么你不需要做任何事来初始化启动你的应用--自动生成的代码已经自动给我们添加了上面的内容!
52+
如果你是使用slc loopback创建应用的, [Application generator](/doc/zh/lb2/Application-generator.html),那么你不需要做任何事来初始化启动你的应用--自动生成的代码已经自动给我们添加了上面的内容!
5353

5454
" %}
5555

pages/zh/lb2/6095040.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ summary:
2222

2323
{% include note.html content="
2424

25-
For an introductory example of defining a remote method, see [Extend your API](/doc/{{page.lang}}/lb2/Extend-your-API.html) in Getting Started.
25+
For an introductory example of defining a remote method, see [Extend your API](/doc/zh/lb2/Extend-your-API.html) in Getting Started.
2626

2727
" %}
2828

@@ -78,7 +78,7 @@ module.exports = function(Person) {
7878

7979
{% include note.html content="
8080

81-
注意上面的REST API都使用了person的复数形式people。Loopback暴露[plural form of model names for REST API routes](/doc/{{page.lang}}/lb2/Exposing-models-over-REST.html#ExposingmodelsoverREST-RESTpaths).
81+
注意上面的REST API都使用了person的复数形式people。Loopback暴露[plural form of model names for REST API routes](/doc/zh/lb2/Exposing-models-over-REST.html#ExposingmodelsoverREST-RESTpaths).
8282

8383
" %}
8484

pages/zh/lb2/6095042.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ summary:
1111

1212
{% include warning.html content="
1313

14-
**模型钩子过时了,除了[afterInitialize](/doc/{{page.lang}}/lb2/6095042.html).**
14+
**模型钩子过时了,除了[afterInitialize](/doc/zh/lb2/6095042.html).**
1515

1616
**请使用[操作钩子](https://docs.strongloop.com/display/LB/Operation+hooks)**
1717

pages/zh/lb2/6095063.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ summary:
1111

1212
{% include important.html content="
1313

14-
**Prerequisite**: Install StrongLoop software following the instructions in [LoopBack初级教程](/doc/{{page.lang}}/lb2/6095006.html).
14+
**Prerequisite**: Install StrongLoop software following the instructions in [LoopBack初级教程](/doc/zh/lb2/6095006.html).
1515

1616
" %}
1717

@@ -30,7 +30,9 @@ The `slc loopback` command provides an [Application generator](/doc/{{page.la
3030

3131
{% include note.html content="
3232

33-
The `slc` command has many additional sub-commands not specific to LoopBack for building, deploying, and managing Node applications. See [Operating Node applications](https://docs.strongloop.com/display/SLC/Operating+Node+applications) for more information and [Command-line reference](https://docs.strongloop.com/display/NODE/Command-line+reference) for the command reference.
33+
The `slc` command has many additional sub-commands not specific to LoopBack for building, deploying, and managing Node applications.
34+
See [Operating Node applications](https://docs.strongloop.com/display/SLC/Operating+Node+applications) for more information
35+
and [Command-line reference](https://docs.strongloop.com/display/NODE/Command-line+reference) for the command reference.
3436

3537
" %}
3638

pages/zh/lb2/6095111.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ summary:
1111

1212
{% include important.html content="
1313

14-
**请先阅读此文,** 然后根据 [LoopBack初级教程](/doc/{{page.lang}}/lb2/6095006.html) 创建一个简单的Loopback应用。
14+
**请先阅读此文,** 然后根据 [LoopBack初级教程](/doc/zh/lb2/6095006.html) 创建一个简单的Loopback应用。
1515

1616
" %}
1717

pages/zh/lb2/6095114.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ summary:
2323

2424
Methods of models in the [AngularJS client](https://docs.strongloop.com/display/zh/AngularJS+JavaScript+SDK) have a different signature than those of the Node API. For more information, see [AngularJS SDK API](http://apidocs.strongloop.com/loopback-sdk-angular/).
2525

26-
" %}`{ fields: {_propertyName_: <true|false>, _propertyName_: <true|false>, ... } }`Where:
26+
" %}
27+
28+
`{ fields: {_propertyName_: <true|false>, _propertyName_: <true|false>, ... } }`Where:
2729

2830
* _propertyName_ 是你要include或者exclude属性的属性名
2931
* <true|false> 标示是include还是exclude。true代表include,false代表exclude。

pages/zh/lb2/6095116.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@ summary:
1515

1616
基于一个属性:
1717

18-
`filter[order]=_propertyName_ <ASC|DESC>`Order by two or more properties:`filter[order][0]=_propertyName_ <ASC|DESC>&filter[order][1]_propertyName_]=<ASC|DESC>...`可以在REST query中使用[stringified JSON format](/doc/{{page.lang}}/lb2/Querying-data.html#Queryingdata-UsingstringifiedJSONinRESTqueries){% include note.html content="
18+
`filter[order]=_propertyName_ <ASC|DESC>`Order by two or more properties:`filter[order][0]=_propertyName_ <ASC|DESC>&filter[order][1]_propertyName_]=<ASC|DESC>...`可以在REST query中使用[stringified JSON format](/doc/{{page.lang}}/lb2/Querying-data.html#Queryingdata-UsingstringifiedJSONinRESTqueries)
1919

20-
可以在[default scope](/doc/{{page.lang}}/lb2/Model-definition-JSON-file.html#ModeldefinitionJSONfile-Defaultscope)中配置默认排序规则。
20+
{% include note.html content="
21+
22+
可以在[default scope](/doc/zh/lb2/Model-definition-JSON-file.html#ModeldefinitionJSONfile-Defaultscope)中配置默认排序规则。
2123

2224
" %}
2325

2426
### Node API
2527

2628
{% include warning.html content="
2729

28-
Methods of models in the [AngularJS client](https://docs.strongloop.com/display/zh/AngularJS+JavaScript+SDK) have a different signature than those of the Node API. For more information, see [AngularJS SDK API](http://apidocs.strongloop.com/loopback-sdk-angular/).
30+
Methods of models in the [AngularJS client](https://docs.strongloop.com/display/zh/AngularJS+JavaScript+SDK) have a different signature than those of the Node API.
31+
For more information, see [AngularJS SDK API](http://apidocs.strongloop.com/loopback-sdk-angular/).
2932

3033
" %}
3134

pages/zh/lb2/6095118.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ where过滤器指定了匹配的where条件,类似于SQL的where。
1515

1616
下面的代码使用等于条件
1717

18-
```js
18+
```
1919
filter[where][_property_] = _value_
2020
2121
filter[where][_property_][_op_] = _value_
22-
```可以在REST query中使用[stringified JSON format](/doc/{{page.lang}}/lb2/Querying-data.html#Queryingdata-UsingstringifiedJSONinRESTqueries)。
22+
```
23+
24+
可以在REST query中使用[stringified JSON format](/doc/{{page.lang}}/lb2/Querying-data.html#Queryingdata-UsingstringifiedJSONinRESTqueries)
2325

2426
### Node API
2527

0 commit comments

Comments
 (0)