Skip to content

Commit f80b50b

Browse files
committed
translate 03-advanced-svelte/05-bindings into Japanese
1 parent 7f64f0e commit f80b50b

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

content/tutorial/03-advanced-svelte/05-bindings/01-contenteditable-bindings/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Contenteditable bindings
33
---
44

5-
Elements with a `contenteditable="true"` attribute support `textContent` and `innerHTML` bindings:
5+
`contenteditable="true"` 属性を持つ要素は、`textContent` `innerHTML` のバインディングをサポートします。
66

77
```svelte
88
<div

content/tutorial/03-advanced-svelte/05-bindings/02-each-block-bindings/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Each block bindings
33
---
44

5-
You can even bind to properties inside an `each` block.
5+
`each` ブロック内のプロパティにバインドすることもできます。
66

77
```svelte
88
{#each todos as todo}
@@ -18,4 +18,4 @@ You can even bind to properties inside an `each` block.
1818
{/each}
1919
```
2020

21-
> Note that interacting with these `<input>` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
21+
> これらの `<input>` 要素と互いに作用すると、配列が突然変化することに注意してください。不変のデータを扱いたい場合は、バインディングを避け、代わりにイベントハンドラを使用する必要があります。

content/tutorial/03-advanced-svelte/05-bindings/03-media-elements/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Media elements
33
---
44

5-
> This exercise doesn't currently work. You can switch to the old tutorial instead: https://svelte.dev/tutorial/media-elements
5+
> この練習問題は現時点では動作しません。代わりに、既存のチュートリアルをお試しください: https://svelte.jp/tutorial/media-elements
66
7-
The `<audio>` and `<video>` elements have several properties that you can bind to. This example demonstrates a few of them.
7+
`<audio>` `<video>` 要素にはいくつかバインドできるプロパティがあります。この例では、その内のいくつかをお見せします。
88

9-
On line 62, add `currentTime={time}`, `duration` and `paused` bindings:
9+
62行目に `currentTime={time}``duration``paused` プロパティを追加しバインドします:
1010

1111
```svelte
1212
<video
@@ -23,27 +23,27 @@ On line 62, add `currentTime={time}`, `duration` and `paused` bindings:
2323
</video>
2424
```
2525

26-
> `bind:duration` is equivalent to `bind:duration={duration}`
26+
> `bind:duration` `bind:duration={duration}` に相当します
2727
28-
Now, when you click on the video, it will update `time`, `duration` and `paused` as appropriate. This means we can use them to build custom controls.
28+
このとき動画をクリックすると、`time``duration``paused` が適宜更新されます。つまり、それらを使ってカスタムコントロールを構築することができるということです。
2929

30-
> Ordinarily on the web, you would track `currentTime` by listening for `timeupdate` events. But these events fire too infrequently, resulting in choppy UI. Svelte does better — it checks `currentTime` using `requestAnimationFrame`.
30+
> 通常、 web 上では `timeupdate` イベントを検知することで `currentTime` を追跡しますが、これらのイベントはそれほど頻繁に発生しないため、結果的にぎこちない UI になってしまいます。それを Svelte は上手く処理しています。`requestAnimationFrame` を使用して `currentTime` をチェックすることで。
3131
32-
The complete set of bindings for `<audio>` and `<video>` is as follows — six _readonly_ bindings...
32+
`<audio>` `<video>` のバインディングの全セットは以下の通りです。6つの _読み込み専用_ バインディング…
3333

34-
- `duration` (readonly) — the total duration of the video, in seconds
35-
- `buffered` (readonly) — an array of `{start, end}` objects
36-
- `seekable` (readonly) — ditto
37-
- `played` (readonly) — ditto
38-
- `seeking` (readonly) — boolean
39-
- `ended` (readonly) — boolean
34+
- `duration` (読み込み専用) — 動画の総再生時間(秒単位)
35+
- `buffered` (読み込み専用) — `{start, end}` オブジェクトの配列
36+
- `seekable` (読み込み専用) — 同上
37+
- `played` (読み込み専用) — 同上
38+
- `seeking` (読み込み専用) — 真偽値
39+
- `ended` (読み込み専用) — 真偽値
4040

41-
...and five _two-way_ bindings:
41+
…と5つの _双方向_ バインディングです:
4242

43-
- `currentTime`the current point in the video, in seconds
44-
- `playbackRate`how fast to play the video, where `1` is 'normal'
45-
- `paused`this one should be self-explanatory
46-
- `volume`a value between 0 and 1
47-
- `muted`a boolean value where true is muted
43+
- `currentTime`動画内の現在のポイント(秒単位)
44+
- `playbackRate`動画の再生速度(`1` 'normal'
45+
- `paused`これは自明のこと
46+
- `volume`0 から 1 の値
47+
- `muted` — true はミュートを意味するブーリアン値
4848

49-
Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
49+
動画には読み取り専用の `videoWidth` `videoHeight` バインディングも存在します。

content/tutorial/03-advanced-svelte/05-bindings/04-dimensions/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
title: Dimensions
33
---
44

5-
Every block-level element has `clientWidth`, `clientHeight`, `offsetWidth` and `offsetHeight` bindings:
5+
全てのブロックレベル要素は `clientWidth` `clientHeight``offsetWidth``offsetHeight` バインディングを備えています:
66

77
```svelte
88
<div bind:clientWidth={w} bind:clientHeight={h}>
99
<span style="font-size: {size}px">{text}</span>
1010
</div>
1111
```
1212

13-
These bindings are readonly — changing the values of `w` and `h` won't have any effect.
13+
これらのバインディングは読み取り専用です。`w` `h` の値を変更しても何の影響もありません。
1414

15-
> Elements are measured using a technique similar to [this one](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/). There is some overhead involved, so it's not recommended to use this for large numbers of elements.
15+
> 要素は[この方法](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/)に似た手法を用いて測定されます。オーバーヘッドを内包しているため、要素数が巨大な場合はこの方法を使用することはおすすめしません。
1616
>
17-
> `display: inline` elements cannot be measured with this approach; nor can elements that can't contain other elements (such as `<canvas>`). In these cases you will need to measure a wrapper element instead.
17+
> `display: inline` 要素、または他の要素を内包できない要素(`<canvas>` など)もこの手法では測定できません。この場合は、代わりにラッバー要素を測定する必要があります。

content/tutorial/03-advanced-svelte/05-bindings/05-bind-this/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: This
33
---
44

5-
The readonly `this` binding applies to every element (and component) and allows you to obtain a reference to rendered elements. For example, we can get a reference to a `<canvas>` element:
5+
読み取り専用の `this` バインディングは全要素(および 全コンポーネント)に適用され、レンダリングされた要素を参照することができます。例えば、`<canvas>` 要素への参照を得られます:
66

77
```svelte
88
<canvas
@@ -12,4 +12,4 @@ The readonly `this` binding applies to every element (and component) and allows
1212
></canvas>
1313
```
1414

15-
Note that the value of `canvas` will be `undefined` until the component has mounted, so we put the logic inside the `onMount` [lifecycle function](/tutorial/onmount).
15+
注意 `canvas` の値はコンポーネントがマウントされるまで `undefined` になるので、`onMount` という[ライフサイクル関数](/tutorial/onmount)内にロジックを含めていることに注意してください。

content/tutorial/03-advanced-svelte/05-bindings/06-component-bindings/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Component bindings
33
---
44

5-
Just as you can bind to properties of DOM elements, you can bind to component props. For example, we can bind to the `value` prop of this `<Keypad>` component as though it were a form element:
5+
DOM 要素のプロパティにバインドできるのと同様に、コンポーネントの props にもバインドできます。例えば、フォーム要素のように `<Keypad>` コンポーネントの `value` prop にバインドすることができます。
66

77
```svelte
88
<Keypad
@@ -11,6 +11,6 @@ Just as you can bind to properties of DOM elements, you can bind to component pr
1111
/>
1212
```
1313

14-
Now, when the user interacts with the keypad, the value of `pin` in the parent component is immediately updated.
14+
これで、ユーザがキーパッドを操作すると、親コンポーネントの `pin` の値が即座に更新されるようになりました。
1515

16-
> Use component bindings sparingly. It can be difficult to track the flow of data around your application if you have too many of them, especially if there is no 'single source of truth'.
16+
> コンポーネントバインディングは控えめに使用してください。それらが多すぎるとアプリケーションの周りのデータの流れを追跡するのが困難になります。特に「信頼できる唯一の情報源(single source of truth)」が存在しない場合には。

content/tutorial/03-advanced-svelte/05-bindings/07-component-this/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Binding to component instances
33
---
44

5-
Just as you can bind to DOM elements, you can bind to component instances themselves. For example, we can bind the instance of `<InputField>` to a variable named `field` in the same way we did when binding DOM Elements
5+
DOM要素にバインドできるのと同じように、コンポーネントのインスタンス自体にもバインドできます。たとえば、DOM要素をバインドするときと同じように、`<InputField>` のインスタンスを `field` 変数にバインドすることができます。
66

77
```svelte
88
<script>
@@ -12,12 +12,12 @@ Just as you can bind to DOM elements, you can bind to component instances themse
1212
<InputField bind:this={field} />
1313
```
1414

15-
Now we can programmatically interact with this component using `field`.
15+
これで、`field` を使って、このコンポーネントをプログラムで操作できるようになりました。
1616

1717
```svelte
1818
<button on:click="{() => field.focus()}">
1919
Focus field
2020
</button>
2121
```
2222

23-
> Note that we can't do `{field.focus}` since field is undefined when the button is first rendered and throws an error.
23+
> なお、ボタンが最初にレンダリングされたとき、fieldは未定義であり、エラーが発生するため、`{field.focus}` をすることはできません。

0 commit comments

Comments
 (0)