-
Notifications
You must be signed in to change notification settings - Fork 141
translate(content): service-worker-getting-started.md #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Circle CIを見るとひっかかっているのは別の箇所のようですが、ローカルでひっかかりますか?
|
a3b3253 to
2ae41ee
Compare
|
なるほど、試しにprh.ymlのルールを次のように変えてみて変化を見てもらえますか? |
|
期待通りの挙動になっていそうです。 |
|
prh.ymlへのdiffも含めていただいてOKです |
7f6bc4b to
c7c9e3f
Compare
|
パスしました🙆♂️ |
c7c9e3f to
08bab18
Compare
| * `favicon.ico` | ||
| * ビルド成果物(JSおよびCSSバンドル) | ||
| * `assets`の下にあるもの(訳注:assets下にさらに階層を作っている場合は、`ngsw-config.json`の設定を階層に合わせて`/assets/**/**`などのように変えてください。) | ||
| * `assets`の下にあるもの |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
勘違いだったみたいなので削除しました。
(手元でキャッシュされなかったのですが、別の原因ぽく、現状はglobフォーマット通り/asset/**でasset/images/hoge.pngなども読めてます。)
|
|
||
|
|
||
| Beginning in Angular 5.0.0, you can easily enable Angular service worker support in any CLI project. This document explains how to enable Angular service worker support in new and existing projects. It then uses a simple example to show you a service worker in action, demonstrating loading and basic caching. | ||
| Angular 5.0.0から、どのCLIプロジェクトでもAngular Service Workerのサポートを簡単に有効にすることができます。このドキュメントでは、新規および既存のプロジェクトでAngular Service Workerのサポートを有効にする方法について説明します。次に、単純な例を使用して、Service Workerが実際に動作していることを確認し、読み込みとキャッシングの基本をデモで行います。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
デモで行います -> 実演します がよいでしょう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。
| 1. Service Workerのパッケージを追加します。 | ||
| 2. CLIでService Workerのビルドサポートを有効にします。 | ||
| 3. Service Workerをインポートして登録します。 | ||
| 4. キャッシングビヘイビアなどの設定を指定するService Workerの設定ファイルを作成します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キャッシングビヘイビア => キャッシュの振る舞い がよいでしょう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。
| <code-example path="service-worker-getting-started/src/app/app.module.ts" linenums="false" title="src/app/app.module.ts" region="sw-module"> </code-example> | ||
|
|
||
| The file `ngsw-worker.js` is the name of the prebuilt service worker script, which the CLI copies into `dist/` to deploy along with your server. | ||
| `ngsw-worker.js`ファイルは、CLIがあなたのサーバーに一緒にデプロイするために`dist/`にコピーする、事前構築されたService Workerのスクリプト名称です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
スクリプトの名前 でいいと思います
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サーバーに一緒にデプロイするためにCLIがdist/にコピーする のほうが係り受けがわかりやすそうです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。確かにその係り受けが自然ですね。翻訳は直訳の係り受けをいかに読み易くするかみたいなところありますね...。
| Angular CLIには、`ngsw-config.json`というService Workerの設定ファイルが必要です。設定ファイルは、Service Workerがファイルおよびデータリソースをどのようにキャッシュするかを制御します。 | ||
|
|
||
| You can begin with the boilerplate version from the CLI, which configures sensible defaults for most applications. | ||
| CLIからボイラープレート版を始めることができます。このボイラープレート版では、多くのアプリケーションで適切であろう推奨設定が行われています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLIによるひな形を使って始めることができます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました
| ### `http-server`を供給する | ||
|
|
||
| Because `ng serve` does not work with service workers, you must use a seperate HTTP server to test your project locally. You can use any HTTP server. The example below uses the [http-server](https://www.npmjs.com/package/http-server) package from npm. To reduce the possibility of conflicts, test on a dedicated port. | ||
| `ng serve`はService Workerでは機能しないので、プロジェクトをローカルでテストするためには、別個のHTTPサーバーを使用する必要があります。任意のHTTPサーバーを使用できます。次の例では、npmから[http-server](https://www.npmjs.com/package/http-server)パッケージを使用しています。競合する可能性を減らすために、専用ポートでテストしてください。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ng serveはService Workerと連携しないので`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
別個の => 別の
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました
| `ng serve`はService Workerでは機能しないので、プロジェクトをローカルでテストするためには、別個のHTTPサーバーを使用する必要があります。任意のHTTPサーバーを使用できます。次の例では、npmから[http-server](https://www.npmjs.com/package/http-server)パッケージを使用しています。競合する可能性を減らすために、専用ポートでテストしてください。 | ||
|
|
||
| To serve with `http-server`, change to the directory containing your web files and start the web server: | ||
| `http-server`で供給するために、Webファイルが入っているディレクトリ(訳注:`ng build --prod`で作成されたフォルダ。通常なら`dist`)に移動し、Webサーバーを起動してください。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サンプルコードで cd しているので、ここで訳注は不要かと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
時間経って見直すと不要ですね。削除しました。
| AngularにおけるService Workerを使用しないアプリケーションの場合、リフレッシュすると「インターネット接続がありません」と記載されたChromeのインターネット切断ページが表示されます。 | ||
|
|
||
| With the addition of an Angular service worker, the application behavior changes. On a refresh, the page loads normally. | ||
| AngularにおけるService Workerを追加すると、アプリケーションの動作が変更されます。リフレッシュ時に、ページが正常にロードされます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular Service Worker がよいでしょう
| 2. アプリケーションタブを閉じますが、ウィンドウは閉じません。これにより、開発者ツールも閉じる必要があります。 | ||
|
|
||
| 3. Shut down `http-server`. | ||
| 3. `http-server`を落とします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
シャットダウン にしましょう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。
|
翻訳ありがとうございます!いくつかの部分で修正をお願いします 🙇 |
| <hr /> | ||
|
|
||
| ## More on Angular service workers | ||
| ## もっとAngularにおけるService Workerを知りたい |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular Service Worker でよいでしょう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。最初のintroduction.mdも修正PR上げます
|
@lacolaco レビューありがとうございました。修正をアップしました:bow: |
|
修正ありがとうございました! |


related to #97
訳注を2つ入れています。(余計な気もするから採用するかは判断お願いします。)Service WorkerルールにServiceWorkerModuleなどの固有名詞が引っかかります。