Skip to content

Translate api docs #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions source/api/filters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Filters
title: フィルタ
type: api
order: 7
---
Expand All @@ -17,19 +17,19 @@ order: 7

### currency

- this filter takes one optional argument
- このフィルタは1つ任意な引数を必要とします

*12345 => $12,345.00*

You can pass an optional argument which will be used as the currency symbol (default is $).
通貨記号(デフォルトは`$`)として使用される任意な引数を渡すことができます。

### pluralize

- this filter takes at least one argument
- このフィルタは少なくとも1つ引数を必要とします

Pluralizes the argument based on the filtered value. When there is exactly one arg, plural forms simply add an "s" at the end. When there are more than one argument, the arguments will be used as array of strings corresponding to the single, double, triple ... forms of the word to be pluralized. When the number to be pluralized exceeds the length of the args, it will use the last entry in the array.
フィルタされた値に基づいた引数を複数形にします。ちょうど1つの引数が指定されているとき、単純にその引数の終わりに "s" を追加します。よりもっと多くの引数が指定されているとき、それらの引数は、1、2、3、というような、複数形化される言葉の形式に対応する文字列の配列として利用されます。複数形化される数が引数の長さを上回るとき、それは配列の最後のエントリを利用します。

**Example:**
**:**

``` html
{{count}} {{count | pluralize item}}
Expand All @@ -42,7 +42,7 @@ Pluralizes the argument based on the filtered value. When there is exactly one a
{{date}}{{date | pluralize st nd rd th}}
```

Will result in:
以下は結果になります:

*1 => '1st'*
*2 => '2nd'*
Expand All @@ -52,20 +52,20 @@ Will result in:

### json

- this filter takes one optional argument
- このフィルタは1つ任意な引数を必要とします

JSON.stringify() incoming value rather than outputting the string representation (i.e. `[object Object]`). It also takes one optional argument which is the indent level (defaults to 2):
文字列表現(いわゆる`[object Object]`)を出力するというよりむしろ入ってくる値を JSON.stringify() を実行するフィルタです。このフィルタは、インデントレベルを1つ任意な引数として必要とします(デフォルトは 2):

``` html
<pre>{{$data | json 4}}</pre>
```

### key

- this filter only works in `v-on`
- this filter takes exactly one argument
- このフィルタは `v-on` でのみ動作します
- このフィルタはちょうど1つ引数を必要とします

Wrap the handler so it only gets called when the keyCode matches the argument. You can also use string aliases for a few commonly-used keys:
キーコード(keyCode) が引数と一致するときだけ呼び出されるために、`v-on` に指定されたハンドラ(handler) を Wrap します。少数のよく使われるキーの代わりに、以下のような文字列エイリアスも利用できます。

- enter
- tab
Expand All @@ -76,22 +76,22 @@ Wrap the handler so it only gets called when the keyCode matches the argument. Y
- left
- right

**Example:**
**:**

``` html
<input v-on="keyup:doSomething | key enter">
```

`doSomething` will only be called when the Enter key is pressed.
`doSomething` Enter キーが押されたときにのみ呼び出されます。

### filterBy

**Syntax:** `filterBy searchKey [in dataKey]`.
**構文:** `filterBy searchKey [in dataKey]`.

- this filter only works in `v-repeat`
- this is a computed filter
- このフィルタは `v-repeat` でのみ動作します
- これは computed なフィルタです

Make `v-repeat` only display a filtered version of the source Array. The `searchKey` argument is a property key on the context ViewModel. The value of that property will be used as the string to search for:
`v-repeat` でのみ、元の配列のフィルタされたバージョンを表示させます。`searchkey` 引数は ViewModel コンテキスト上のプロパティキーです。プロパティの値は文字列として検索するために利用されます:

``` html
<input v-model="searchText">
Expand All @@ -100,9 +100,9 @@ Make `v-repeat` only display a filtered version of the source Array. The `search
</ul>
```

When the filter is applied, it will filter the `users` Array by recursively searching for the current value of `searchText` on each item in the Array. For example, if an item is `{ name: 'Jack', phone: '555-123-4567' }` and `searchText` has value `'555'`, the item will be considered a match.
上記では、フィルタが適用されたとき、`users` 配列は配列の各アイテムに対して `searchText` の現在値に適した再帰的検索によってフィルタされます。例えば、もしアイテムが `{ name: 'Jack', phone: '555-123-4567' }` そして `searchText` の値が `'555'` の場合、そのアイテムは一致するとみなされます。

Optionally, you can narrow down which specific property to search in with the optional `in dataKey` argument:
その他に、任意な `in dataKey` 引数では特定のプロパティを検索して絞ることができます:

``` html
<input v-model="searchText">
Expand All @@ -111,9 +111,9 @@ Optionally, you can narrow down which specific property to search in with the op
</ul>
```

Now the item will only match if the value of `searchText` is found in its `name` property. So `searchText` with value `'555'` will no longer match this item, but `'Jack'` will.
上記では、今まさに `searchText` の値が `name` プロパティで見つかった場合は、そのアイテムのみが一致します。なので、値 `'555'` な `searchText`は、もはやこのアイテムと一致しませんが、値 `'Jack'` なら一致します。

Finally, you can use quotes to indicate literal arguments:
最後に、リテラル引数を指定するためシングルクオートを利用できます:

``` html
<ul>
Expand All @@ -123,12 +123,12 @@ Finally, you can use quotes to indicate literal arguments:

### orderBy

**Syntax:** `orderBy sortKey [reverseKey]`.
**構文:** `orderBy sortKey [reverseKey]`.

- this filter only works in `v-repeat`
- this is a computed filter
- このフィルタは `v-repeat` でのみ動作します
- これは computed なフィルタです

Sort `v-repeat`'s displayed result. The `sortKey` argument is a property key on the context ViewModel. The value of that property will be used as the key to sort the Array items with. The optional `reverseKey` argument is also a property key on the context ViewModel, but the value's truthiness will determine whether the result should be reversed.
`v-repeat` で表示された結果をソートします。`sortKey` 引数は ViewModel コンテキスト上のプロパティキーです。そのプロパティの値は配列のアイテムをソートするためのキーとして利用されます。任意な `reverseKey` 引数もまた、ViewModel コンテキスト上のプロパティキーです。しかし、この値の真偽は、結果が反転されるべきかどうかを決定します。

``` html
<ul>
Expand All @@ -146,7 +146,7 @@ new Vue({
})
```

You can also use quotes for literal sort key. To indicate a literal reverse, use `-1`:
リテラルな `sortKey` 引数としてシングルクオートも利用できます。ソート順の逆を意味するリテラルとして、`-1` を指定して利用できます:

``` html
<ul>
Expand Down
80 changes: 39 additions & 41 deletions source/api/global-api.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,62 @@
title: Global API
title: グローバル API
type: api
order: 5
---

### Vue.config

`Vue.config` is an object containing Vue's global settings. Here are the list of all the avaiable settings with their default values:
`Vue.config` Vue のグローバル設定を含んでいるオブジェクトです。以下は、デフォルト値で利用可能な設定の全てのリストです:

``` js
{
// print stack trace for warnings?
// 警告するためのスタックトレースを表示するかどうか
debug: true,
// attribute prefix for directives
// directive 向けの属性(attribute)プレフィックス
prefix: 'v-',
// interpolation delimiters
// for HTML interpolations, add
// 1 extra outer-most character.
// HTML 展開に対応するデミリタ、最も外側に特別な1文字を追加
delimiters: ['{{', '}}'],
// suppress warnings?
// 警告を抑制するかどうか
silent: false,
// interpolate mustache bindings?
// mustache バインディングを展開するかどうか
interpolate: true,
// use async updates (for directives & watchers)?
// 非同期更新(directive & watcher 向け)するかどうか
async: true,
// allow altering observed Array's prototype chain?
// 監視された配列プロトタイプチェーンを変更することを許可するかどうか
proto: true
}
```

You can modify them directly, for example:
以下の例のように、それらを直接変更できます:

``` js
Vue.config.debug = true // turn on debugging mode
Vue.config.debug = true // デバッギングモードをオンにする
```

**Debug Mode**
**デバッグモード**

When `Vue.config.debug` is set to true, Vue will automatically use synchronous mode and throw a `debugger` statement when there is a warning. This enables the user to inspect the full stack trace in browser dev tools.
`Vue.config.debug` true に設定されるとき、Vue は自動的に同期モードを使い、そして警告があるときは `debugger` ステートメント を投げます。これはブラウザの開発ツールで、完全なスタックトレースを詳しく調べることが可能になります。

<p class="tip">debug mode is not available in the minified production builds.</p>
<p class="tip">デバッグモードは小さくなった production ビルドでは利用できません。</p>

**Changing Delimiters**
**デリミタの変更**

When the delimiters are set for text interpolation, the delimiters for HTML interpolation will be generated by adding one outer-most symbol on both sides:
デリミタはテキスト展開に対して設定されるとき、HTML 展開に対するデリミタは両側の最も外側のシンボルが追加されることによって生成されます:

``` js
Vue.config.delimiters = ['(%', '%)']
// tags now are (% %) for text
// and ((% %)) for HTML
// タグは現在テキスト展開に対して (% %)
// そして HTML展開に対して ((% %))
```

### Vue.extend( options )

- **options** `Object`

Create a "subclass" of the base Vue constructor. All [instantiation options](/api/options.html) can be used here. The special cases to note here are `el` and `data`, which must be functions in this case.
Vue コンストラクタベースの"サブクラス"を作成します。[instantiation options](/api/options.html) の全てはここで使うことができます。ここでの注意すべき特別なケースは、`el` `data` で、このケースでは関数にしなければなりません。

Internally, `Vue.extend()` is called on all component options before instantiating the components. For more details regarding components, see [Component System](/guide/components.html).
内部的に、`Vue.extend()` は component をインスタンス化する前に、全ての component オプション上で呼び出されます。さらに詳しくは component に関しては、[Component System](/guide/components.html) を参照してください。

**Example**
****

``` js
var Profile = Vue.extend({
Expand All @@ -77,7 +75,7 @@ var profile = new Profile({
profile.$appendTo('body')
```

Will result in:
結果は以下のようになります:

``` html
<p>Walter White aka Heisenberg</p>
Expand All @@ -86,39 +84,39 @@ Will result in:
### Vue.directive( id, [definition] )

- **id** `String`
- **definition** `Function` or `Object` *optional*
- **definition** `Function` または `Object` *任意*

Register or retrieve a global custom directive. For more details see [Writing Custom Directives](/guide/custom-directive.html).
グローバルカスタム directive に登録または取得します。さらに詳しくは [Writing Custom Directives](/guide/custom-directive.html) を参照してください。

### Vue.filter( id, [definition] )

- **id** `String`
- **definition** `Function` *optional*
- **definition** `Function` *任意*

Register or retrieve a global custom filter. For more details see [Writing Custom Filters](/guide/custom-filter.html).
グローバルカスタム fitler に登録または取得します。さらに詳しくは [Writing Custom Filters](/guide/custom-filter.html) を参照してください。

### Vue.component( id, [definition] )

- **id** `String`
- **definition** `Function Constructor` or `Object` *optional*
- **definition** `Function` コンストラクタ または `Object` *任意*

Register or retrieve a global component. For more details see [Component System](/guide/components.html).
グローバル component に登録または取得します。さらに詳しくは [Component System](/guide/components.html) を参照してください。

### Vue.transition( id, [definition] )

- **id** `String`
- **definition** `Object` *optional*
- **definition** `Object` *任意*

Register or retrieve a global JavaScript transition effect definition. For more details see the guide for [JavaScript Transitions](/guide/transitions.html#JavaScript_Functions).
グローバル JavaScript transition effect definition に登録または取得します。さらに詳しくガイド向けの [JavaScript Transitions](/guide/transitions.html#JavaScript_Functions) を参照してください。

### Vue.partial( id, [definition] )

- **id** `String`
- **definition** `String | Node` *optional*
- **definition** `String | Node` *任意*

Register or retrieve a global partial. The definition can be a template string, a querySelector that starts with `#`, a DOM element (whose innerHTML will be used as the template string), or a DocumentFragment.
グローバル partial に登録または取得します。定義にはテンプレート文字列の場合があり、querySelector `#` で始まるか、DOM 要素 (`innerHTML`はテンプレート文字列として利用される) か、また Documentfragment です。

**Example**
****

HTML

Expand All @@ -141,7 +139,7 @@ new Vue({
})
```

Will result in:
結果は以下のようになります:

``` html
<div id="demo">
Expand All @@ -153,15 +151,15 @@ Will result in:

- **callback** `Function`

Vue.js batches view updates and executes them all asynchronously. It uses `requestAnimationFrame` if available and falls back to `setTimeout(fn, 0)`. This method calls the callback after the next view update, which can be useful when you want to wait until the view has been updated.
Vue.js のバッチは view を更新し、非同期にそれらを全て実行します。それは可能なら `MutationObserver` 使い、可能でないなら `setTimeout(fn, 0)` にフォールバックします。このメソッドは view を更新した後に、callback を呼び出し、view が更新されるまで待ちたいときに役にたちます。

### Vue.use( plugin, [args...] )

- **plugin** `Object` or `Function`
- **args...** *optional*
- **plugin** `Object` または `Function`
- **args...** *任意*

Mount a Vue.js plugin. If the plugin is an Object, it must have an `install` method. If it is a function itself, it will be treated as the install method. The install method will be called with Vue as the argument. For more details, see [Plugins](/guide/extending.html#Extend_with_Plugins).
Vue.js plugin をマウントします。もし、plugin がオブジェクトなら、それは `install` メソッドを実装していなければなりません。もし、それ自身が関数ならば、それは install メソッドとして扱われます。install メソッドは、Vue を引数として呼び出されます。さらに詳しくは、[Plugins](/guide/extending.html#Extend_with_Plugins) を参照してください。

### Vue.util

Exposes the internal `util` module, which contains a number of utility methods. This is intended for advanced plugin/directive authoring, so you will need to look at the source code to see what's available.
多数のユーティリティメソッドを含む内部 `util` モジュールを公開します。これは高度な plugin/directive 作成向けに目的としており、そのため、何が可能かどうか確認するためにソースコードを見る必要があります。