Skip to content

Commit 61d5f6d

Browse files
committed
translate 02-sveltekit/04-forms/05-customizing-use-enhance into Japanese
1 parent 681b8b1 commit 61d5f6d

File tree

1 file changed

+5
-5
lines changed
  • content/tutorial/02-sveltekit/04-forms/05-customizing-use-enhance

1 file changed

+5
-5
lines changed

content/tutorial/02-sveltekit/04-forms/05-customizing-use-enhance/README.md

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

5-
With `use:enhance`, we can go further than just emulating the browser's native behaviour. By providing a callback, we can add things like **pending states** and **optimistic UI**. Let's simulate a slow network by adding an artificial delay to our two actions:
5+
`use:enhance` を使えば、ブラウザネイティブな動作をエミュレートするだけでなく、さらに踏み込んだことができます。コールバックを提供することで、**待機状態(pending states)** **楽観的なUI(optimistic UI)** を追加することができます。私たちの2つの action にわざと遅延を追加し、遅いネットワークをシミュレートしましょう。
66

77
```js
88
/// file: src/routes/+page.server.js
@@ -19,7 +19,7 @@ export const actions = {
1919
};
2020
```
2121

22-
When we create or delete items, it now takes a full second before the UI updates, leaving the user wondering if they messed up somehow. To solve that, add some local state...
22+
アイテムを作成または削除するとき、UI の更新まで丸1秒かかるようになっており、ユーザーはなにか失敗したのかと思うようになります。これを解決するには、ローカルの状態(local state)をいくつか追加します…
2323

2424
```svelte
2525
/// file: src/routes/+page.svelte
@@ -35,7 +35,7 @@ When we create or delete items, it now takes a full second before the UI updates
3535
</script>
3636
```
3737

38-
...and toggle `creating` inside the first `use:enhance`:
38+
…そして1つ目の `use:enhance` の内側で、`creating` を切り替えます。
3939

4040
```svelte
4141
<form
@@ -62,7 +62,7 @@ When we create or delete items, it now takes a full second before the UI updates
6262
</form>
6363
```
6464

65-
In the case of deletions, we don't really need to wait for the server to validate anything — we can just update the UI immediately:
65+
削除の場合、サーバーがなにか検証するのを待つ必要はありません — すぐに UI を更新することができます。
6666

6767
```svelte
6868
<ul>
@@ -89,4 +89,4 @@ In the case of deletions, we don't really need to wait for the server to validat
8989
</ul>
9090
```
9191

92-
> `use:enhance` is very customizable — you can `cancel()` submissions, handle redirects, control whether the form is reset, and so on. [See the docs](https://kit.svelte.dev/docs/modules#$app-forms-enhance) for full details.
92+
> `use:enhance` はとてもカスタマイズしやすく、フォーム送信の `cancel()`、リダイレクト処理、form をリセットするかどうかの制御、などを行うことができます。詳細については [ドキュメントをご覧ください](https://kit.svelte.jp/docs/modules#$app-forms-enhance)

0 commit comments

Comments
 (0)