Skip to content

Commit 8201a5c

Browse files
committed
translate exercises into Japanese
1 parent 3e78565 commit 8201a5c

File tree

3 files changed

+27
-27
lines changed
  • content/tutorial/02-advanced-svelte

3 files changed

+27
-27
lines changed

content/tutorial/02-advanced-svelte/04-actions/02-adding-parameters-to-actions/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Adding parameters
33
---
44

5-
Like transitions and animations, an action can take an argument, which the action function will be called with alongside the element it belongs to.
5+
トランジションとアニメーションと同じように、アクションは引数を取ることができます。その引数と、アクション関数自身が属する要素を以って、アクション関数は呼び出されます。
66

7-
In this exercise, we want to add a tooltip to the `<button>` using the [`Tippy.js`](https://atomiks.github.io/tippyjs/) library. The action is already wired up with `use:tooltip`, but if you hover over the button (or focus it with the keyboard) the tooltip contains no content.
7+
この演習では、[`Tippy.js`](https://atomiks.github.io/tippyjs/) ライブラリを使って `<button>` にツールチップを追加したいと思います。アクションはすでに `use:tooltip` によって紐付けられていますが、ボタンをホバーしても (キーボードでフォーカスしても) ツールチップには何も表示されません。
88

9-
First, the action needs to accept some options and pass them to Tippy:
9+
最初に、アクションでオプションを受け取り、それを Tippy に渡さなければなりません:
1010

1111
```js
1212
/// file: App.svelte
@@ -21,7 +21,7 @@ function tooltip(node, +++options+++) {
2121
}
2222
```
2323

24-
Then, we need to pass some options into the action:
24+
それから、オプションをアクションに渡します:
2525

2626
```svelte
2727
/// file: App.svelte
@@ -30,7 +30,7 @@ Then, we need to pass some options into the action:
3030
</button>
3131
```
3232

33-
The tooltip now works — almost. If we change the text in the `<input>`, the tooltip will not reflect the new content. We can fix that by adding an `update` method to the returned object.
33+
これでツールチップが動作します — ほとんどは。`<input>` のテキストを変更しても、ツールチップに新しい内容が反映されません。`update` メソッドを追加し、オブジェクトを返すことでこれを修正します。
3434

3535
```js
3636
/// file: App.svelte

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

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

5-
You can bind to properties of `<audio>` and `<video>` elements, making it easy to (for example) build custom player UI, like `AudioPlayer.svelte`.
5+
`<audio>` 要素と `<video>` 要素のプロパティをバインドすることができるので、(例えば) `AudioPlayer.svelte` のようなカスタムのプレーヤー UI をとても簡単に作ることができます。
66

7-
First, add the `<audio>` element along with its bindings (we'll use the shorthand form for `duration` and `paused`):
7+
最初に、`<audio>` 要素とそのバインディングを追加します (`duration` `paused` は短縮形を使います):
88

99
```svelte
1010
/// file: AudioPlayer.svelte
@@ -22,7 +22,7 @@ First, add the `<audio>` element along with its bindings (we'll use the shorthan
2222
/>
2323
```
2424

25-
Next, add an event handler to the `<button>` that toggles `paused`:
25+
次に、`paused` を切り替える `<button>` にイベントハンドラを追加します:
2626

2727
```svelte
2828
/// file: AudioPlayer.svelte
@@ -33,7 +33,7 @@ Next, add an event handler to the `<button>` that toggles `paused`:
3333
/>
3434
```
3535

36-
Our audio player now has basic functionality. Let's add the ability to seek to a specific part of a track by dragging the slider. Inside the slider's `pointerdown` handler there's a `seek` function, where we can update `time`:
36+
これでオーディオプレーヤーに基本的な機能が付きました。では、スライダーをドラッグして曲の指定した部分にシークできる機能を追加しましょう。スライダー(slider)の `pointerdown` ハンドラの内側にある `seek` 関数で、`time` を更新することができます:
3737

3838
```js
3939
/// file: AudioPlayer.svelte
@@ -48,7 +48,7 @@ function seek(e) {
4848
}
4949
```
5050

51-
When the track ends, be kind — rewind:
51+
曲が終わったら、親切に巻き戻しましょう:
5252

5353
```svelte
5454
/// file: AudioPlayer.svelte
@@ -63,21 +63,21 @@ When the track ends, be kind — rewind:
6363
/>
6464
```
6565

66-
The complete set of bindings for `<audio>` and `<video>` is as follows — six _readonly_ bindings...
66+
`<audio>` `<video>` のバインディングの完全なセットは以下の通りです — 6つの _読み取り専用(readonly)_ のバインディング…
6767

68-
- `duration` (readonly) — the total duration of the video, in seconds
69-
- `buffered` (readonly) — an array of `{start, end}` objects
70-
- `seekable` (readonly) — ditto
71-
- `played` (readonly) — ditto
68+
- `duration` (readonly) — ビデオの総再生時間 (秒単位)
69+
- `buffered` (readonly) — `{start, end}` オブジェクトの配列
70+
- `seekable` (readonly) — 同上
71+
- `played` (readonly) — 同上
7272
- `seeking` (readonly) — boolean
7373
- `ended` (readonly) — boolean
7474

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

77-
- `currentTime`the current point in the video, in seconds
78-
- `playbackRate`how fast to play the video, where `1` is 'normal'
79-
- `paused`this one should be self-explanatory
80-
- `volume`a value between 0 and 1
81-
- `muted`a boolean value where true is muted
77+
- `currentTime`ビデオ内の現在のポイント (秒単位)
78+
- `playbackRate`ビデオの再生速度 (`1` 'normal')
79+
- `paused`これは自明ですね
80+
- `volume`0 から 1 の値
81+
- `muted` — boolean で、true はミュートを意味します
8282

83-
Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
83+
video には読み取り専用の `videoWidth` `videoHeight` バインディングがあります。

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

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

5-
Just as you can bind to DOM elements, you can bind to component instances themselves with `bind:this`.
5+
DOM 要素にバインドできるのと同じように、`bind:this` でコンポーネントインスタンス自体にバインドすることができます。
66

7-
This is useful in the rare cases that you need to interact with a component programmatically (rather than by providing it with updated props). Revisiting our canvas app from [a few exercises ago](actions), it would be nice to add a button to clear the screen.
7+
ごく稀に、(更新されたプロパティを提供するのではなく) プログラム的にコンポーネントと対話しなければならないことがあり、これはそれに有用です。[少し前の演習](actions)の canvas アプリを振り返ると、画面をクリアするボタンを追加するともっとよくなりそうです。
88

9-
First, let's export a function from `Canvas.svelte`:
9+
最初に、`Canvas.svelte` から関数をエクスポートしましょう:
1010

1111
```svelte
1212
/// file: Canvas.svelte
@@ -18,7 +18,7 @@ export let size;
1818
}+++
1919
```
2020

21-
Then, create a reference to the component instance:
21+
次に、コンポーネントインスタンスの参照を作成します:
2222

2323
```svelte
2424
/// file: App.svelte
@@ -38,7 +38,7 @@ Then, create a reference to the component instance:
3838
<Canvas +++bind:this={canvas}+++ color={selected} size={size} />
3939
```
4040

41-
Finally, add a button that calls the `clear` function:
41+
最後に、`clear` 関数を呼び出すボタンを追加します:
4242

4343
```svelte
4444
/// file: App.svelte

0 commit comments

Comments
 (0)