Skip to content

Commit 69d008e

Browse files
shimotmkfellyph
andauthored
Add Japanese translations to Blueprint Bundles and API Consistency (#2438)
## Motivation for the change, related issues Part of #2202 Add Japanese translations to Blueprint Bundles and API Consistency Co-authored-by: Fellyph Cintra <[email protected]>
1 parent ad8b23d commit 69d008e

File tree

2 files changed

+349
-0
lines changed

2 files changed

+349
-0
lines changed
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
---
2+
title: ブループリントバンドル
3+
slug: /blueprints/bundles
4+
---
5+
6+
# ブループリントバンドル
7+
8+
<!--
9+
# Blueprint Bundles
10+
-->
11+
12+
ブループリントバンドルは、ブループリント宣言(`blueprint.json`)と、コンパイルおよび実行に必要なすべての追加リソースを含む自己完結型パッケージです。これにより、WordPress Playground の完全なセットアップを容易に配布・共有できます。
13+
14+
<!--
15+
Blueprint bundles are self-contained packages that include a Blueprint declaration (`blueprint.json`) along with all the additional resources required to compile and run it. This makes it easier to distribute and share complete WordPress Playground setups.
16+
-->
17+
18+
## What are Blueprint Bundles?
19+
20+
<!--
21+
## ブループリント バンドルとは何ですか?
22+
-->
23+
24+
ブループリント バンドルは、次のものを含むファイルのコレクションです:
25+
26+
<!--
27+
A Blueprint bundle is a collection of files that includes:
28+
-->
29+
30+
1. ブループリントの設定を定義する `blueprint.json` ファイル
31+
2. ブループリントが参照する追加リソース(テーマ、プラグイン、コンテンツファイルなど)
32+
33+
<!--
34+
1. A `blueprint.json` file that defines the Blueprint configuration
35+
2. Any additional resources referenced by the Blueprint (themes, plugins, content files, etc.)
36+
-->
37+
38+
ブループリント バンドルはさまざまな形式で配布できます:
39+
40+
<!--
41+
Blueprint bundles can be distributed in various formats:
42+
-->
43+
44+
- トップレベルの `blueprint.json` ファイルと追加リソースを含む ZIP ファイル
45+
- Git リポジトリ内の `blueprint.json` とその他のリソースが格納されているディレクトリ
46+
- コンピュータ上のローカルディレクトリ
47+
- 関連ファイルがインライン化されたインライン JavaScript オブジェクト
48+
49+
<!--
50+
- A ZIP file with a top-level `blueprint.json` file and additional resources
51+
- A directory inside a git repository where `blueprint.json` resides alongside other resources
52+
- A local directory on your computer
53+
- An inline JavaScript object with the relevant files inlined
54+
-->
55+
56+
## ブループリントバンドルの使用
57+
58+
<!--
59+
## Using Blueprint Bundles
60+
-->
61+
62+
### ウェブサイト
63+
64+
<!--
65+
### On the Website
66+
-->
67+
68+
WordPress Playground ウェブサイトは、`?blueprint-url=` クエリパラメータを通じて Blueprint バンドルをサポートしています。Blueprint バンドルを含む ZIP ファイルの URL を指定できます。
69+
70+
<!--
71+
The WordPress Playground website supports Blueprint bundles through the `?blueprint-url=` query parameter. You can provide a URL to a ZIP file containing your Blueprint bundle.
72+
-->
73+
74+
```
75+
https://playground.wordpress.net/?blueprint-url=https://example.com/my-blueprint-bundle.zip
76+
```
77+
78+
ZIP ファイルには、ルート レベルの `blueprint.json` ファイルと、ブループリントによって参照される追加のリソースが含まれている必要があります。
79+
80+
<!--
81+
The ZIP file should contain a `blueprint.json` file at the root level, along with any additional resources referenced by the Blueprint.
82+
-->
83+
84+
### CLI の場合
85+
86+
<!--
87+
### In the CLI
88+
-->
89+
90+
Playground CLI は `--blueprint=` オプションを通じてブループリントバンドルをサポートします。以下のオプションを指定できます:
91+
92+
<!--
93+
The Playground CLI supports Blueprint bundles through the `--blueprint=` option. You can provide:
94+
-->
95+
96+
- ブループリントバンドルを含むローカルディレクトリへのパス
97+
- ブループリントバンドルを含むローカル ZIP ファイルへのパス
98+
- リモートブループリントバンドルへの URL (http:// または https://)
99+
100+
<!--
101+
- A path to a local directory containing a Blueprint bundle
102+
- A path to a local ZIP file containing a Blueprint bundle
103+
- A URL to a remote Blueprint bundle (http:// or https://)
104+
-->
105+
106+
例えば:
107+
108+
<!--
109+
For example:
110+
-->
111+
112+
```bash
113+
# Using a local ZIP file
114+
npx @wp-playground/cli --blueprint=./my-blueprint.zip server
115+
116+
# Using a remote URL
117+
npx @wp-playground/cli --blueprint=https://example.com/my-blueprint.zip server
118+
119+
# Using a local directory
120+
npx @wp-playground/cli --blueprint=./my-blueprint-directory server
121+
```
122+
123+
デフォルトでは、セキュリティ上の理由から、CLI はローカルファイルへのアクセスを制限します。ブループリントが同じ親ディレクトリ内のファイルにアクセスする必要がある場合は、`--blueprint-may-read-adjacent-files`フラグを使用して明示的に権限を付与する必要があります。
124+
125+
<!--
126+
By default, the CLI restricts access to local files for security reasons. If your Blueprint needs to access files in the same parent directory, you need to explicitly grant permission using the `--blueprint-may-read-adjacent-files` flag:
127+
-->
128+
129+
```bash
130+
npx @wp-playground/cli --blueprint=./my-blueprint.json --blueprint-may-read-adjacent-files server
131+
```
132+
133+
## ブループリントバンドルの作成
134+
135+
<!--
136+
## Creating Blueprint Bundles
137+
-->
138+
139+
### 基本構造
140+
141+
<!--
142+
### Basic Structure
143+
-->
144+
145+
基本的なブループリント バンドルは次のようになります:
146+
147+
<!--
148+
A basic Blueprint bundle might look like this:
149+
-->
150+
151+
```
152+
my-blueprint-bundle/
153+
├── blueprint.json
154+
├── theme.zip
155+
├── plugin.zip
156+
└── content/
157+
└── sample-content.wxr
158+
```
159+
160+
### バンドルされたリソースを含むブループリントの例
161+
162+
<!--
163+
### Example Blueprint with Bundled Resources
164+
-->
165+
166+
バンドルされたリソースを参照する `blueprint.json` ファイルの例を次に示します。
167+
168+
<!--
169+
Here's an example of a `blueprint.json` file that references bundled resources:
170+
-->
171+
172+
```json
173+
{
174+
"landingPage": "/my-file.txt",
175+
"steps": [
176+
{
177+
"step": "writeFile",
178+
"path": "/wordpress/my-file.txt",
179+
"data": {
180+
"resource": "bundled",
181+
"path": "/bundled-text-file.txt"
182+
}
183+
},
184+
{
185+
"step": "installTheme",
186+
"themeData": {
187+
"resource": "bundled",
188+
"path": "/theme.zip"
189+
}
190+
},
191+
{
192+
"step": "installPlugin",
193+
"pluginData": {
194+
"resource": "bundled",
195+
"path": "/plugin.zip"
196+
}
197+
},
198+
{
199+
"step": "importWxr",
200+
"file": {
201+
"resource": "bundled",
202+
"path": "/content/sample-content.wxr"
203+
}
204+
}
205+
]
206+
}
207+
```
208+
209+
この例では、ブループリントはバンドルされたいくつかのリソースを参照します:
210+
211+
<!--
212+
In this example, the Blueprint references several bundled resources:
213+
-->
214+
215+
- `/bundled-text-file.txt` にあるテキストファイル
216+
- `/theme.zip` にあるテーマの ZIP ファイル
217+
- `/plugin.zip` にあるプラグインの ZIP ファイル
218+
- `/content/sample-content.wxr` にある WXR コンテンツファイル
219+
220+
<!--
221+
- A text file at `/bundled-text-file.txt`
222+
- A theme ZIP file at `/theme.zip`
223+
- A plugin ZIP file at `/plugin.zip`
224+
- A WXR content file at `/content/sample-content.wxr`
225+
-->
226+
227+
### ZIP バンドルの作成
228+
229+
<!--
230+
### Creating a ZIP Bundle
231+
-->
232+
233+
ZIP バンドルを作成するには、`blueprint.json` と必要なすべてのリソースを含むディレクトリを作成し、それを ZIP 形式で圧縮するだけです:
234+
235+
<!--
236+
To create a ZIP bundle, simply create a directory with your `blueprint.json` and all required resources, then zip it up:
237+
-->
238+
239+
```bash
240+
# Create a directory for your bundle
241+
mkdir my-blueprint-bundle
242+
cd my-blueprint-bundle
243+
244+
# Create your blueprint.json and add resources
245+
# ...
246+
247+
# Zip it up
248+
zip -r ../my-blueprint-bundle.zip .
249+
```
250+
251+
## トラブルシューティング
252+
253+
<!--
254+
## Troubleshooting
255+
-->
256+
257+
ブループリント バンドルで問題が発生した場合:
258+
259+
<!--
260+
If you encounter issues with Blueprint bundles:
261+
-->
262+
263+
1. `blueprint.json` ファイルが ZIP ファイルのルートレベルにあることを確認してください。
264+
2. バンドルされたリソース参照内のすべてのパスが正しいことを確認してください。
265+
3. ZIP ファイルが適切にフォーマットされていることを確認してください。
266+
4. CLI を使用する場合は、`--blueprint-may-read-adjacent-files` フラグが必要かどうかを確認してください。
267+
5. 必要なすべてのリソースがバンドルに含まれていることを確認してください。
268+
269+
<!--
270+
1. Ensure your `blueprint.json` file is at the root level of your ZIP file
271+
2. Check that all paths in your bundled resource references are correct
272+
3. Verify that your ZIP file is properly formatted
273+
4. When using the CLI, check if you need the `--blueprint-may-read-adjacent-files` flag
274+
5. Ensure all required resources are included in the bundle
275+
-->
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: APIの一貫性
3+
slug: /blueprints/steps/api-consistency
4+
---
5+
6+
# JSON API と関数 API
7+
8+
<!--
9+
# JSON API and Function API
10+
-->
11+
12+
ブループリントは JSON 形式で定義されますが、基盤となる実装では JavaScript 関数を使用してステップを実行します。JSON はブループリントを操作する最も便利な方法ですが、基盤となる関数を直接使用することもできます。
13+
14+
<!--
15+
Blueprints are defined in JSON format, but the underlying implementation uses JavaScript functions to execute the steps. While JSON is the most convenient way of interacting with Blueprints, you can also use the underlying functions directly.
16+
-->
17+
18+
JSON は関数を包むラッパーに過ぎません。JSON ステップを使用する場合でも、エクスポートされた関数を使用する場合でも、同じパラメータ(ステップ名を除く)を指定する必要があります。
19+
20+
<!--
21+
JSON is merely a wrapper around the functions. Whether you use the JSON steps or the exported functions, you'll have to provide the same parameters (except for the step name):
22+
-->
23+
24+
Blueprints は、WordPress Playground の Web バージョンと node.js バージョンの両方で使用できます。
25+
26+
<!--
27+
You can use Blueprints both with the web and the node.js versions of WordPress Playground.
28+
-->
29+
30+
:::info ブループリント バージョン 2
31+
32+
チームは、Blueprints を TypeScript ライブラリから PHP ライブラリに移行する方法を検討しています。これにより、Playground、ホストされたサイト、ローカル環境など、あらゆる WordPress 環境で Blueprints を実行できるようになります。
33+
34+
提案されている [新しい仕様](https://github.com/WordPress/blueprints-library/issues/6) については、別の [GitHub リポジトリ](https://github.com/WordPress/blueprints-library/) で議論されています。ぜひご参加ください(GitHub リポジトリまたは [#playground](https://wordpress.slack.com/archives/C04EWKGDJ0K) Slack チャンネルで)。次世代の Playground の策定にご協力ください。
35+
:::
36+
37+
<!--
38+
:::info Blueprints version 2
39+
40+
The team is exploring ways to transition Blueprints from a TypeScript library to a PHP library. This would allow people to run Blueprints in any WordPress environments: Playground, a hosted site, or a local setup.
41+
42+
The proposed [new specification](https://github.com/WordPress/blueprints-library/issues/6) is discussed on a separate [GitHub repository](https://github.com/WordPress/blueprints-library/), and you’re more than welcome to join (there or on the [#playground](https://wordpress.slack.com/archives/C04EWKGDJ0K) Slack channel) and help shape the next generation of Playground.
43+
:::
44+
-->
45+
46+
## JSON API と関数 API の違い
47+
48+
<!--
49+
## Differences between JSON and Function APIs
50+
-->
51+
52+
JSON API と Function API には主に 2 つの違いがあります:
53+
54+
<!--
55+
There are two main differences between the JSON and Function APIs:
56+
-->
57+
58+
1. ブループリントはプログレスバーとエラーレポートを自動的に処理します。関数 API を使用する場合は、これらを自分で処理する必要があります。
59+
2. 関数 API を使用する場合は API クライアントライブラリをインポートする必要がありますが、ブループリントは URL フラグメントに貼り付けるだけで済みます。
60+
61+
<!--
62+
1. Blueprints handle the progress bar and error reporting for you. The function API requires you to handle these yourself.
63+
2. The function API requires importing the API client library while Blueprints may be just pasted into the URL fragment.
64+
-->
65+
66+
:::note
67+
このトピックの詳細については、[wordpress-playground](https://github.com/WordPress/wordpress-playground) リポジトリの [Blueprint JSON 定義とステップ ハンドラーに同じ構造を使用する](https://github.com/WordPress/wordpress-playground/pull/215) の問題を確認してください。
68+
:::
69+
70+
<!--
71+
:::note
72+
Check the [Use the same structure for Blueprint JSON definitions and step handlers](https://github.com/WordPress/wordpress-playground/pull/215) issue at [wordpress-playground](https://github.com/WordPress/wordpress-playground) repo for more detailed info about this topic
73+
:::
74+
-->

0 commit comments

Comments
 (0)