Skip to content

Commit e0ed0fb

Browse files
author
T2
committed
translate(content): service-worker-communications.md
1 parent db17a88 commit e0ed0fb

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
# Service Worker Communication
1+
# Service Workerと通信する
22

3-
Importing `ServiceWorkerModule` into your `AppModule` doesn't just register the service worker, it also provides a few services you can use to interact with the service worker and control the caching of your app.
3+
`AppModule``ServiceWorkerModule`をインポートしたら、Service Workerを登録するだけではなく、Service Workerと対話してアプリケーションのキャッシュを制御するためのサービスも使えるようになります。
44

5-
#### Prerequisites
5+
#### 前提条件
66

7-
A basic understanding of the following:
8-
* [Getting Started with Service Workers](guide/service-worker-getting-started).
7+
次の基本的理解があること
8+
* [Service Workerを始める](guide/service-worker-getting-started)
99

1010
<hr />
1111

1212

13-
## `SwUpdate` service
13+
## `SwUpdate`サービス
1414

15-
The `SwUpdate` service gives you access to events that indicate when the service worker has discovered an available update for your app or when it has activated such an update&mdash;meaning it is now serving content from that update to your app.
15+
`SwUpdate`サービスは、Service Workerがあなたのアプリケーションで利用可能なアップデートを発見したとき、またはそのアップデートをアクティブにしたときを示すイベントへのアクセスを提供します。
1616

17-
The `SwUpdate` service supports four separate operations:
18-
* Getting notified of *available* updates. These are new versions of the app to be loaded if the page is refreshed.
19-
* Getting notified of update *activation*. This is when the service worker starts serving a new version of the app immediately.
20-
* Asking the service worker to check the server for new updates.
21-
* Asking the service worker to activate the latest version of the app for the current tab.
17+
`SwUpdate`サービスは4つの操作をサポートします。
18+
* *利用可能*なアップデートの通知を受け取る。これらは、ページが更新されたときに読み込まれる新しいバージョンのアプリケーションです。
19+
* *アクティブ化*したアップデートの通知を受け取る。これは、Service Workerがすぐに新しいバージョンのアプリケーションのサービスを開始するときです。
20+
* 新しい更新のためにサーバーをチェックするようにService Workerに依頼する。
21+
* 現在のタブの最新バージョンのアプリケーションを有効にするようにService Workerに依頼する。
2222

23-
### Available and activated updates
23+
### 利用可能でアクティブ化したアップデート
2424

25-
The two update events, `available` and `activated`, are `Observable` properties of `SwUpdate`:
25+
`available``activated`の2つのアップデートイベントは、`SwUpdate``Observable`プロパティです。
2626

2727
<code-example path="service-worker-getting-started/src/app/log-update.service.ts" linenums="false" title="log-update.service.ts" region="sw-update"> </code-example>
2828

2929

30-
You can use these events to notify the user of a pending update or to refresh their pages when the code they are running is out of date.
30+
これらのイベントを使用して、保留中のアップデートをユーザーに通知したり、実行中のコードが古い場合にページを更新したりすることができます。
3131

32-
### Checking for updates
32+
### アップデートをチェックする
3333

34-
It's possible to ask the service worker to check if any updates have been deployed to the server. You might choose to do this if you have a site that changes frequently or want updates to happen on a schedule.
34+
Service Workerに、サーバーにデプロイされたアップデートがあるかどうかを確認させることができます。頻繁に変更されるサイトがある場合やスケジュールに基づいて更新が行われるようにする場合は、これを選択することもできます。
3535

36-
Do this with the `checkForUpdate()` method:
36+
`checkForUpdate()`メソッドで行います。
3737

3838
<code-example path="service-worker-getting-started/src/app/check-for-update.service.ts" linenums="false" title="check-for-update.service.ts" region="sw-check-update"> </code-example>
3939

4040

41-
This method returns a `Promise` which indicates that the update check has completed successfully, though it does not indicate whether an update was discovered as a result of the check. Even if one is found, the service worker must still successfully download the changed files, which can fail. If successful, the `available` event will indicate availability of a new version of the app.
41+
このメソッドは、更新チェックが正常に完了したことを示すPromiseを返しますが、チェックの結果アップデートが検出されたかどうかは示しません。アップデートが見つかったとしても、Service Workerは変更されたファイルを正常にダウンロードする必要があり、まだ失敗する可能性があるからです。成功した場合、availableイベントが、新しいバージョンのアプリケーションが使用可能になったことを示します。
4242

43-
### Forcing update activation
43+
### アップデートのアクティブ化を強制する
4444

45-
If the current tab needs to be updated to the latest app version immediately, it can ask to do so with the `activateUpdate()` method:
45+
現在のタブを最新のアプリケーションバージョンに直ちに更新する必要がある場合は、`activateUpdate()`メソッドを使用して要求することができます。
4646

4747
<code-example path="service-worker-getting-started/src/app/prompt-update.service.ts" linenums="false" title="prompt-update.service.ts" region="sw-activate"> </code-example>
4848

49-
Doing this could break lazy-loading into currently running apps, especially if the lazy-loaded chunks use filenames with hashes, which change every version.
49+
これを行うと、現在実行中のアプリケーションの遅延ロードが中断される可能性があります。特に遅延ロードされるチャンクが、バージョンごとに変更されるハッシュをファイル名に使用している場合です。
5050

51-
## More on Angular service workers
51+
## もっとAngularにおけるService Workerを知りたい
5252

53-
You may also be interested in the following:
54-
* [Service Worker in Production](guide/service-worker-devops).
53+
次の記事がお勧めです。
54+
* [プロダクション環境のService Worker](guide/service-worker-devops).

0 commit comments

Comments
 (0)