Skip to content

Commit 886b1dc

Browse files
committed
translate exercises into Japanese
1 parent 8dbe740 commit 886b1dc

File tree

3 files changed

+8
-8
lines changed
  • content/tutorial/03-advanced-svelte

3 files changed

+8
-8
lines changed

content/tutorial/03-advanced-svelte/07-composition/02-named-slots/README.md

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

5-
The previous example contained a _default slot_, which renders the direct children of a component. Sometimes you will need more control over placement. In those cases, we can use _named slots_.
5+
前回の例には _default slot_ があり、それはコンポーネントの直接の子をレンダリングするものでした。時々、配置場所をもっとコントロールしなければならないときがあると思います。そのような場合は、 _named slots_ を使用することができます。
66

7-
Inside the `<Card>` component, we've got `<span slot="telephone">` and others for `company` and `address`. Let's add the corresponding named slots in `Card.svelte`:
7+
`<Card>` コンポーネントの子として、すでに `<span slot="telephone">` や、その他 `company` `address` が置いてあります。これに対応するように、named slots `Card.svelte` に追加しましょう:
88

99
```svelte
1010
/// file: Card.svelte
@@ -22,7 +22,7 @@ Inside the `<Card>` component, we've got `<span slot="telephone">` and others fo
2222
</div>
2323
```
2424

25-
We need to add some styles to the `<small>` element so that it occupies its own line. The contents of `<Card>` inherit styles from `Card.svelte`, such as `font-family` (the lettering is something called ['Silian Rail'](https://www.youtube.com/watch?v=aZVkW9p-cCU)), but normal scoping rules apply — we need to add the styles to `App.svelte` because that's where the element is:
25+
`<small>` 要素にいくつかスタイルを追加して、自身の行におさまるようにします。`<Card>` のコンテンツは `Card.svelte` から `font-family` (この書体は ['Silian Rail'](https://www.youtube.com/watch?v=aZVkW9p-cCU) と呼ばれます) などのスタイルを継承しますが、通常のスコープのルールが適用されるため、この要素がある場所、つまり `App.svelte` にスタイルを追加します:
2626

2727
```svelte
2828
/// file: App.svelte
@@ -42,7 +42,7 @@ We need to add some styles to the `<small>` element so that it occupies its own
4242
</style>
4343
```
4444

45-
Alternatively, we could use the `:global` modifier inside `Card.svelte` to target all `small` elements inside `.card`:
45+
別の方法として、`Card.svelte` の中で `:global` 修飾子を使用して `.card` の内側にあるすべての `small` 要素をターゲットにすることができます:
4646

4747
```svelte
4848
/// file: Card.svelte

content/tutorial/03-advanced-svelte/07-composition/03-slot-fallbacks/README.md

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

5-
A component can specify _fallbacks_ for any slots that are left empty, by putting content inside the `<slot>` element:
5+
コンポーネントは、`<slot>` 要素の内側にコンテンツを置くことで、slot が空になっているときのための _fallback_ を指定することができます:
66

77
```svelte
88
/// file: Box.svelte

content/tutorial/03-advanced-svelte/09-special-elements/07-svelte-document/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: <svelte:document>
33
---
44

5-
The `<svelte:document>` element allows you to listen for events that fire on `document`. This is useful with events like `selectionchange`, which doesn't fire on `window`.
5+
`<svelte:document>` 要素では `document` で発生するイベントをリスンすることができます。これは、`selectionchange` のような、`window` では発生しないイベントを扱うときに便利です。
66

7-
Add the `selectionchange` handler to the `<svelte:document>` tag:
7+
`selectionchange` ハンドラを `<svelte:document>` タグに追加します:
88

99
```svelte
1010
/// file: App.svelte
1111
<svelte:document +++on:selectionchange={handleSelectionChange}+++ />
1212
```
1313

14-
> Avoid `mouseenter` and `mouseleave` handlers on this element, as these events are not fired on `document` in all browsers. Use `<svelte:body>` instead.
14+
> `mouseenter` `mouseleave` はすべてのブラウザで `document` では発生しないため、これらのハンドラをこの要素に追加しないでください。代わりに `<svelte:body>` を使用してください。

0 commit comments

Comments
 (0)