Skip to content

Commit f97becd

Browse files
ultimatileCopilotgomazarashi
authored
/docs/reference/layout/block/および/docs/reference/layout/box/の翻訳 (#179)
Co-authored-by: Copilot <[email protected]> Co-authored-by: gomazarashi <[email protected]>
1 parent a697e20 commit f97becd

File tree

2 files changed

+61
-81
lines changed

2 files changed

+61
-81
lines changed

crates/typst-library/src/layout/container.rs

Lines changed: 59 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ use crate::layout::{
1111
};
1212
use crate::visualize::{Paint, Stroke};
1313

14-
/// An inline-level container that sizes content.
14+
/// コンテンツの大きさを持つインラインレベルのコンテナ。
1515
///
16-
/// All elements except inline math, text, and boxes are block-level and cannot
17-
/// occur inside of a [paragraph]($par). The box function can be used to
18-
/// integrate such elements into a paragraph. Boxes take the size of their
19-
/// contents by default but can also be sized explicitly.
16+
/// インライン数式、テキスト、ボックスを除く全ての要素はブロックレベルであり、[段落]($par)の中に含めることはできません。
17+
/// box関数を用いることで、そのような要素を段落にまとめることができます。
18+
/// ボックスはデフォルトで、受け取ったコンテンツに合わせた大きさになりますが、明示的に大きさを指定することもできます。
2019
///
21-
/// # Example
20+
/// #
2221
/// ```example
2322
/// Refer to the docs
2423
/// #box(
@@ -29,51 +28,48 @@ use crate::visualize::{Paint, Stroke};
2928
/// ```
3029
#[elem]
3130
pub struct BoxElem {
32-
/// The width of the box.
31+
/// ボックスの幅。
3332
///
34-
/// Boxes can have [fractional]($fraction) widths, as the example below
35-
/// demonstrates.
33+
/// ボックスは以下の例で示すように、[比率]($fraction)を用いて幅を指定できます。
3634
///
37-
/// _Note:_ Currently, only boxes and only their widths might be fractionally
38-
/// sized within paragraphs. Support for fractionally sized images, shapes,
39-
/// and more might be added in the future.
35+
/// _注意:_ 現在、パラグラフ内で比率指定が可能なのはボックスおよびその幅のみです。
36+
/// 比率で指定した大きさを持つ画像や図形などは今後サポートされる可能性があります。
4037
///
4138
/// ```example
4239
/// Line in #box(width: 1fr, line(length: 100%)) between.
4340
/// ```
4441
pub width: Sizing,
4542

46-
/// The height of the box.
43+
/// ボックスの高さ。
4744
pub height: Smart<Rel<Length>>,
4845

49-
/// An amount to shift the box's baseline by.
46+
/// ボックスのベースラインをシフトさせる量。
5047
///
5148
/// ```example
5249
/// Image: #box(baseline: 40%, image("tiger.jpg", width: 2cm)).
5350
/// ```
5451
#[resolve]
5552
pub baseline: Rel<Length>,
5653

57-
/// The box's background color. See the
58-
/// [rectangle's documentation]($rect.fill) for more details.
54+
/// ボックスの背景色。
55+
/// 詳細は[rectangleのドキュメント]($rect.fill)を参照してください。
5956
pub fill: Option<Paint>,
6057

61-
/// The box's border color. See the
62-
/// [rectangle's documentation]($rect.stroke) for more details.
58+
/// ボックスの枠線の色。
59+
/// 詳細は[rectangleのドキュメント]($rect.stroke)を参照してください。
6360
#[resolve]
6461
#[fold]
6562
pub stroke: Sides<Option<Option<Stroke>>>,
6663

67-
/// How much to round the box's corners. See the
68-
/// [rectangle's documentation]($rect.radius) for more details.
64+
/// ボックスの角の丸めの大きさ。
65+
/// 詳細は[rectangleのドキュメント]($rect.radius)を参照してください。
6966
#[resolve]
7067
#[fold]
7168
pub radius: Corners<Option<Rel<Length>>>,
7269

73-
/// How much to pad the box's content.
70+
/// ボックスのコンテンツのパディング量。
7471
///
75-
/// _Note:_ When the box contains text, its exact size depends on the
76-
/// current [text edges]($text.top-edge).
72+
/// _注意:_ ボックスがテキストを含むとき、その正確な大きさは現在の[テキストの端]($text.top-edge)に依存します。
7773
///
7874
/// ```example
7975
/// #rect(inset: 0pt)[Tight]
@@ -82,11 +78,10 @@ pub struct BoxElem {
8278
#[fold]
8379
pub inset: Sides<Option<Rel<Length>>>,
8480

85-
/// How much to expand the box's size without affecting the layout.
81+
/// レイアウトに影響を与えずにボックスの大きさを拡大する量。
8682
///
87-
/// This is useful to prevent padding from affecting line layout. For a
88-
/// generalized version of the example below, see the documentation for the
89-
/// [raw text's block parameter]($raw.block).
83+
/// これはパディングが行のレイアウトに影響を与えるのを防ぐために便利です。
84+
/// 以下の例より一般的な場合については、[未加工テキストのblockパラメーター]($raw.block)のドキュメントを参照してください。
9085
///
9186
/// ```example
9287
/// An inline
@@ -101,10 +96,8 @@ pub struct BoxElem {
10196
#[fold]
10297
pub outset: Sides<Option<Rel<Length>>>,
10398

104-
/// Whether to clip the content inside the box.
105-
///
106-
/// Clipping is useful when the box's content is larger than the box itself,
107-
/// as any content that exceeds the box's bounds will be hidden.
99+
/// ボックスの内側のコンテンツのクリッピングを行うか否か。
100+
/// クリッピングは、ボックスの境界を超えたコンテンツを隠すため、ボックスのコンテンツがボックス本体よりも大きい場合に便利です。
108101
///
109102
/// ```example
110103
/// #box(
@@ -117,7 +110,7 @@ pub struct BoxElem {
117110
#[default(false)]
118111
pub clip: bool,
119112

120-
/// The contents of the box.
113+
/// ボックスの内容。
121114
#[positional]
122115
#[borrowed]
123116
pub body: Option<Content>,
@@ -179,18 +172,15 @@ pub enum InlineItem {
179172
Frame(Frame),
180173
}
181174

182-
/// A block-level container.
175+
/// ブロックレベルのコンテナ。
183176
///
184-
/// Such a container can be used to separate content, size it, and give it a
185-
/// background or border.
177+
/// このようなコンテナは、コンテンツを区切り、その大きさを調整し、背景や枠線を付与するために使用できます。
186178
///
187-
/// Blocks are also the primary way to control whether text becomes part of a
188-
/// paragraph or not. See [the paragraph documentation]($par/#what-becomes-a-paragraph)
189-
/// for more details.
179+
/// ブロックは、テキストが段落の一部となるかどうかを制御する主要な方法でもあります。
180+
/// 詳細は[段落のドキュメント]($par/#what-becomes-a-paragraph)を参照してください。
190181
///
191-
/// # Examples
192-
/// With a block, you can give a background to content while still allowing it
193-
/// to break across multiple pages.
182+
/// # 例
183+
/// ブロックを使用すると、複数のページに渡って分割されるコンテンツに背景を与えることができます。
194184
/// ```example
195185
/// #set page(height: 100pt)
196186
/// #block(
@@ -201,8 +191,7 @@ pub enum InlineItem {
201191
/// )
202192
/// ```
203193
///
204-
/// Blocks are also useful to force elements that would otherwise be inline to
205-
/// become block-level, especially when writing show rules.
194+
/// ブロックは、特にshowルールを記述する際、本来インラインとなる要素を強制的にブロックレベルとして扱う場合にも有用です。
206195
/// ```example
207196
/// #show heading: it => it.body
208197
/// = Blockless
@@ -214,7 +203,7 @@ pub enum InlineItem {
214203
/// ```
215204
#[elem]
216205
pub struct BlockElem {
217-
/// The block's width.
206+
/// ブロックの幅。
218207
///
219208
/// ```example
220209
/// #set align(center)
@@ -227,9 +216,8 @@ pub struct BlockElem {
227216
/// ```
228217
pub width: Smart<Rel<Length>>,
229218

230-
/// The block's height. When the height is larger than the remaining space
231-
/// on a page and [`breakable`]($block.breakable) is `{true}`, the
232-
/// block will continue on the next page with the remaining height.
219+
/// ブロックの高さ。
220+
/// 高さがページに残された余白より大きく、[`breakable`]($block.breakable)が`{true}`の場合、 ブロックは残りの高さで次のページに続きます。
233221
///
234222
/// ```example
235223
/// #set page(height: 80pt)
@@ -242,7 +230,7 @@ pub struct BlockElem {
242230
/// ```
243231
pub height: Sizing,
244232

245-
/// Whether the block can be broken and continue on the next page.
233+
/// ブロックが分割可能で次のページに継続するかどうか。
246234
///
247235
/// ```example
248236
/// #set page(height: 80pt)
@@ -256,48 +244,43 @@ pub struct BlockElem {
256244
#[default(true)]
257245
pub breakable: bool,
258246

259-
/// The block's background color. See the
260-
/// [rectangle's documentation]($rect.fill) for more details.
247+
/// ブロックの背景色。
248+
/// 詳細は[rectangleのドキュメント]($rect.fill)を参照してください。
261249
pub fill: Option<Paint>,
262250

263-
/// The block's border color. See the
264-
/// [rectangle's documentation]($rect.stroke) for more details.
251+
/// ブロックの枠線の色。
252+
/// 詳細は[rectangleのドキュメント]($rect.stroke)を参照してください。
265253
#[resolve]
266254
#[fold]
267255
pub stroke: Sides<Option<Option<Stroke>>>,
268256

269-
/// How much to round the block's corners. See the
270-
/// [rectangle's documentation]($rect.radius) for more details.
257+
/// ブロックの角の丸めの大きさ。
258+
/// 詳細は[rectangleのドキュメント]($rect.radius)を参照してください。
271259
#[resolve]
272260
#[fold]
273261
pub radius: Corners<Option<Rel<Length>>>,
274262

275-
/// How much to pad the block's content. See the
276-
/// [box's documentation]($box.inset) for more details.
263+
/// ブロックのコンテンツのパディング量。
264+
/// 詳細は[boxのドキュメント]($box.inset)を参照してください。
277265
#[resolve]
278266
#[fold]
279267
pub inset: Sides<Option<Rel<Length>>>,
280268

281-
/// How much to expand the block's size without affecting the layout. See
282-
/// the [box's documentation]($box.outset) for more details.
269+
/// レイアウトに影響を与えずにブロックの大きさを拡大する量。
270+
/// 詳細は[boxのドキュメント]($box.outset)を参照してください。
283271
#[resolve]
284272
#[fold]
285273
pub outset: Sides<Option<Rel<Length>>>,
286274

287-
/// The spacing around the block. When `{auto}`, inherits the paragraph
288-
/// [`spacing`]($par.spacing).
275+
/// ブロック周りの間隔。`{auto}`の場合、段落の[`spacing`]($par.spacing)を継承します。
289276
///
290-
/// For two adjacent blocks, the larger of the first block's `above` and the
291-
/// second block's `below` spacing wins. Moreover, block spacing takes
292-
/// precedence over paragraph [`spacing`]($par.spacing).
277+
/// 隣接する2つのブロックについては、最初のブロックの`above`と2番目のブロックの`below`のうち、 大きい方の間隔が優先されます。
278+
/// また、ブロックの間隔は段落の[`spacing`]($par.spacing)よりも優先されます。
293279
///
294-
/// Note that this is only a shorthand to set `above` and `below` to the
295-
/// same value. Since the values for `above` and `below` might differ, a
296-
/// [context] block only provides access to `{block.above}` and
297-
/// `{block.below}`, not to `{block.spacing}` directly.
280+
/// これは`above`と`below`を同じ値に設定するための短縮記法にすぎないことに注意してください。
281+
/// `above`と`below`の値は異なる可能性があるため、[context]ブロックでは`{block.above}`と `{block.below}`にのみアクセスでき、`{block.spacing}`に直接アクセスすることはできません。
298282
///
299-
/// This property can be used in combination with a show rule to adjust the
300-
/// spacing around arbitrary block-level elements.
283+
/// このプロパティはshowルールと組み合わせて使用することで、任意のブロックレベル要素の周りの間隔を調整できます。
301284
///
302285
/// ```example
303286
/// #set align(center)
@@ -311,21 +294,20 @@ pub struct BlockElem {
311294
#[default(Em::new(1.2).into())]
312295
pub spacing: Spacing,
313296

314-
/// The spacing between this block and its predecessor.
297+
/// このブロックとその前のブロックとの間隔。
315298
#[parse(
316299
let spacing = args.named("spacing")?;
317300
args.named("above")?.or(spacing)
318301
)]
319302
pub above: Smart<Spacing>,
320303

321-
/// The spacing between this block and its successor.
304+
/// このブロックとその後のブロックとの間隔。
322305
#[parse(args.named("below")?.or(spacing))]
323306
pub below: Smart<Spacing>,
324307

325-
/// Whether to clip the content inside the block.
308+
/// ブロックの内側のコンテンツのクリッピングを行うか否か。
326309
///
327-
/// Clipping is useful when the block's content is larger than the block itself,
328-
/// as any content that exceeds the block's bounds will be hidden.
310+
/// クリッピングは、ブロックの境界を超えたコンテンツを隠すため、ブロックのコンテンツがブロック本体よりも大きい場合に便利です。
329311
///
330312
/// ```example
331313
/// #block(
@@ -338,11 +320,9 @@ pub struct BlockElem {
338320
#[default(false)]
339321
pub clip: bool,
340322

341-
/// Whether this block must stick to the following one, with no break in
342-
/// between.
323+
/// このブロックが、次のブロックとの間に区切りを入れることなく続ける必要があるかどうか。
343324
///
344-
/// This is, by default, set on heading blocks to prevent orphaned headings
345-
/// at the bottom of the page.
325+
/// この設定は、ページの下部で見出しが孤立することを防ぐために、見出しブロックに対してデフォルトで適用されています。
346326
///
347327
/// ```example
348328
/// >>> #set page(height: 140pt)
@@ -356,7 +336,7 @@ pub struct BlockElem {
356336
#[default(false)]
357337
pub sticky: bool,
358338

359-
/// The contents of the block.
339+
/// ブロックの内容。
360340
#[positional]
361341
#[borrowed]
362342
pub body: Option<BlockBody>,

website/translation-status.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
"/docs/reference/layout/align/": "translated",
105105
"/docs/reference/layout/alignment/": "translated",
106106
"/docs/reference/layout/angle/": "translated",
107-
"/docs/reference/layout/block/": "untranslated",
108-
"/docs/reference/layout/box/": "untranslated",
107+
"/docs/reference/layout/block/": "translated",
108+
"/docs/reference/layout/box/": "translated",
109109
"/docs/reference/layout/colbreak/": "untranslated",
110110
"/docs/reference/layout/columns/": "untranslated",
111111
"/docs/reference/layout/direction/": "untranslated",

0 commit comments

Comments
 (0)