[i18n] ja translations developer architecture Service Workers and Scopes#3431
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Japanese (ja) translations for the “Service Workers” and “Scopes” architecture docs as part of #2202.
Changes:
- Added ja translation page for browser service workers, including code examples.
- Added ja translation page for browser scopes, including worker initialization example.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/developers/23-architecture/13-browser-scopes.md | Adds Japanese translation for the “Scopes” doc page. |
| packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/developers/23-architecture/12-browser-service-workers.md | Adds Japanese translation for the “Service Workers” doc page (with setup examples). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const absoluteURL = 'http://127.0.0.1' | ||
|
|
||
| // 代わりに、最初にスコープを設定します。 | ||
| const scope = Math.random().toFixed(16) | ||
| const scopedURL = setURLScope(absoluteURL, scope).toString() | ||
|
|
||
| const { phpVersion } = parseWorkerStartupOptions<{ phpVersion?: string }>(); | ||
| const php = await PHP.load('8.0', { | ||
| requestHandler: { | ||
| documentRoot: '/', | ||
| absoluteUrl: scopedSiteUrl | ||
| } | ||
| }); |
There was a problem hiding this comment.
scopedSiteUrl is not defined in this snippet, and the variable created earlier is scopedURL. This makes the example fail if copied. Update absoluteUrl to use scopedURL (and consider using phpVersion or removing it from the snippet if it’s intentionally unused).
| "default", // PHPインスタンススコープ | ||
| "/sw.js", // 有効な Service Worker 実装を指定する必要があります。 | ||
| "1" // スクリプトの再読み込みに使用されるService Workerのバージョン。 |
There was a problem hiding this comment.
The doc references two different service worker script paths: "/sw.js" in the registration example vs /service-worker.js in the text and filename label. This is confusing for readers and makes the setup steps ambiguous. Use a single consistent filename/path across the snippet and the surrounding explanation (either update the registration example to "/service-worker.js" or change the later references to /sw.js).
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/service-worker.js` ファイルも別途必要です。最小限の実装は次のようになります。 | ||
|
|
||
| <!-- | ||
| You will also need a separate `/service-worker.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | ||
| --> | ||
|
|
||
| **/service-worker.js**: |
There was a problem hiding this comment.
The doc references two different service worker script paths: "/sw.js" in the registration example vs /service-worker.js in the text and filename label. This is confusing for readers and makes the setup steps ambiguous. Use a single consistent filename/path across the snippet and the surrounding explanation (either update the registration example to "/service-worker.js" or change the later references to /sw.js).
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/service-worker.js` ファイルも別途必要です。最小限の実装は次のようになります。 | |
| <!-- | |
| You will also need a separate `/service-worker.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | |
| --> | |
| **/service-worker.js**: | |
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/sw.js` ファイルも別途必要です。最小限の実装は次のようになります。 | |
| <!-- | |
| You will also need a separate `/sw.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | |
| --> | |
| **/sw.js**: |
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/service-worker.js` ファイルも別途必要です。最小限の実装は次のようになります。 | ||
|
|
||
| <!-- | ||
| You will also need a separate `/service-worker.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | ||
| --> | ||
|
|
||
| **/service-worker.js**: |
There was a problem hiding this comment.
The doc references two different service worker script paths: "/sw.js" in the registration example vs /service-worker.js in the text and filename label. This is confusing for readers and makes the setup steps ambiguous. Use a single consistent filename/path across the snippet and the surrounding explanation (either update the registration example to "/service-worker.js" or change the later references to /sw.js).
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/service-worker.js` ファイルも別途必要です。最小限の実装は次のようになります。 | |
| <!-- | |
| You will also need a separate `/service-worker.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | |
| --> | |
| **/service-worker.js**: | |
| また、HTTP リクエストを実際にインターセプトしてルーティングする `/sw.js` ファイルも別途必要です。最小限の実装は次のようになります。 | |
| <!-- | |
| You will also need a separate `/sw.js` file that actually intercepts and routes the HTTP requests. Here's what a minimal implementation looks like: | |
| --> | |
| **/sw.js**: |
Motivation for the change, related issues
Part of #2202
Add Japanese translations to Service Workers and Scopes