Skip to content

Commit 35517f2

Browse files
committed
/docs/reference/layout/placeの翻訳を追加
1 parent 5f2fdaa commit 35517f2

File tree

2 files changed

+45
-66
lines changed

2 files changed

+45
-66
lines changed

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

Lines changed: 44 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,20 @@ use crate::foundations::{elem, scope, Cast, Content, Packed, Smart};
22
use crate::introspection::{Locatable, Unqueriable};
33
use crate::layout::{Alignment, Em, Length, Rel};
44

5-
/// Places content relatively to its parent container.
5+
/// 親コンテナに対して相対的なコンテンツの配置。
66
///
7-
/// Placed content can be either overlaid (the default) or floating. Overlaid
8-
/// content is aligned with the parent container according to the given
9-
/// [`alignment`]($place.alignment), and shown over any other content added so
10-
/// far in the container. Floating content is placed at the top or bottom of
11-
/// the container, displacing other content down or up respectively. In both
12-
/// cases, the content position can be adjusted with [`dx`]($place.dx) and
13-
/// [`dy`]($place.dy) offsets without affecting the layout.
7+
/// コンテンツはオーバーレイ(デフォルト)またはフロートのいずれかで配置できます。
8+
/// オーバーレイのコンテンツは、指定された[`alignment`]($place.alignment)に従って親コンテナに合わせて配置され、これまでに追加された他のコンテンツの上に表示されます。
9+
/// フロートのコンテンツは、親コンテナの上部または下部に配置され、他のコンテンツを下または上にそれぞれずらします。
10+
/// 両方の場合で、コンテンツの位置は[`dx`]($place.dx)および[`dy`]($place.dy)オフセットを用いてレイアウトに影響を与えることなく調整可能です。
1411
///
15-
/// The parent can be any container such as a [`block`], [`box`],
16-
/// [`rect`], etc. A top level `place` call will place content directly
17-
/// in the text area of the current page. This can be used for absolute
18-
/// positioning on the page: with a `top + left`
19-
/// [`alignment`]($place.alignment), the offsets `dx` and `dy` will set the
20-
/// position of the element's top left corner relatively to the top left corner
21-
/// of the text area. For absolute positioning on the full page including
22-
/// margins, you can use `place` in [`page.foreground`]($page.foreground) or
23-
/// [`page.background`]($page.background).
12+
/// [`block`]、[`box`]、[`rect`]などの任意のコンテナが親になることができます。
13+
/// トップレベルの`place`の呼び出しは現在のページのテキスト領域に直接コンテンツを配置します。
14+
/// これはページ上の絶対位置指定に使用できます。
15+
/// `top + left` [`alignment`]($place.alignment)と組み合わせると、`dx`および`dy`オフセットはテキスト領域の左上隅を基準として要素の左上隅の位置を設定します。
16+
/// マージンを含めたページ全体における絶対位置指定は、[`page.foreground`]か[`page.background`]中で`place`を使うと可能です。
2417
///
25-
/// # Examples
18+
/// #
2619
/// ```example
2720
/// #set page(height: 120pt)
2821
/// Hello, world!
@@ -40,17 +33,14 @@ use crate::layout::{Alignment, Em, Length, Rel};
4033
/// )
4134
/// ```
4235
///
43-
/// # Effect on the position of other elements { #effect-on-other-elements }
44-
/// Overlaid elements don't take space in the flow of content, but a `place`
45-
/// call inserts an invisible block-level element in the flow. This can
46-
/// affect the layout by breaking the current paragraph. To avoid this,
47-
/// you can wrap the `place` call in a [`box`] when the call is made
48-
/// in the middle of a paragraph. The alignment and offsets will then be
49-
/// relative to this zero-size box. To make sure it doesn't interfere with
50-
/// spacing, the box should be attached to a word using a word joiner.
36+
/// # 他の要素の位置に対する影響 { #effect-on-other-elements }
37+
/// 要素のオーバーレイはコンテンツの流れの中にスペースを取りませんが、`place`の呼び出しは、流れの中にブロックレベルの不可視要素を挿入します。
38+
///これは現在の段落を中断することでレイアウトに影響を与える可能性があります。
39+
/// 段落の真ん中で呼び出しが行われるとき、`place`の呼び出しを[`box`]でラップすることでこれを避けることができます。
40+
/// alignmentとオフセットはこの大きさを持たないボックスを基準にしたものになります。
41+
/// 間隔に影響しないように、ワードジョイナーを使用してボックスを単語に結合してください。
5142
///
52-
/// For example, the following defines a function for attaching an annotation
53-
/// to the following word:
43+
/// 例えば、以下は直後の単語に注釈を付与する関数を定義しています。
5444
///
5545
/// ```example
5646
/// >>> #set page(height: 70pt)
@@ -64,32 +54,26 @@ use crate::layout::{Alignment, Em, Length, Rel};
6454
/// square in my text.
6555
/// ```
6656
///
67-
/// The zero-width weak spacing serves to discard spaces between the function
68-
/// call and the next word.
57+
/// ゼロ幅の弱い空白は、関数呼び出しと次の単語との間の空白を削除する役割を果たします。
6958
#[elem(scope, Locatable, Unqueriable)]
7059
pub struct PlaceElem {
71-
/// Relative to which position in the parent container to place the content.
60+
/// コンテンツを配置する基準となる親コンテナ内の位置。
7261
///
73-
/// - If `float` is `{false}`, then this can be any alignment other than `{auto}`.
74-
/// - If `float` is `{true}`, then this must be `{auto}`, `{top}`, or `{bottom}`.
62+
/// - `float``{false}`の場合、`{auto}`以外の任意のalignmentを指定できます。
63+
/// - `float``{true}`の場合、`{auto}``{top}`あるいは`{bottom}`のいずれかを指定しなければなりません。
7564
///
76-
/// When `float` is `{false}` and no vertical alignment is specified, the
77-
/// content is placed at the current position on the vertical axis.
65+
/// `float`が`{false}`で、かつvertical alignmentが指定されていなければ、コンテンツは垂直方向の軸上の現在の位置に配置されます。
7866
#[positional]
7967
#[default(Smart::Custom(Alignment::START))]
8068
pub alignment: Smart<Alignment>,
8169

82-
/// Relative to which containing scope something is placed.
70+
/// 何かを配置するときの基準となる包含スコープ。
8371
///
84-
/// The parent scope is primarily used with figures and, for
85-
/// this reason, the figure function has a mirrored [`scope`
86-
/// parameter]($figure.scope). Nonetheless, it can also be more generally
87-
/// useful to break out of the columns. A typical example would be to
88-
/// [create a single-column title section]($guides/page-setup-guide/#columns)
89-
/// in a two-column document.
72+
/// 親スコープは主に図表に使用されるため、figure関数にはそれを反映した[`scope`パラメーター]($figure.scope)が用意されています。
73+
/// しかしながら、段組を中断することは、より一般的な場合に有用であることもあります。
74+
/// 典型的な例は2段組の文書で1段組のタイトル節を作成することでしょう。
9075
///
91-
/// Note that parent-scoped placement is currently only supported if `float`
92-
/// is `{true}`. This may change in the future.
76+
/// 現在、親スコープでの配置は`float`が`{true}`の場合のみサポートされています。 この挙動は将来変更される可能性があります。
9377
///
9478
/// ```example
9579
/// #set page(height: 150pt, columns: 2)
@@ -104,12 +88,11 @@ pub struct PlaceElem {
10488
/// ```
10589
pub scope: PlacementScope,
10690

107-
/// Whether the placed element has floating layout.
91+
/// 要素をフロートレイアウトで配置するかどうか。
10892
///
109-
/// Floating elements are positioned at the top or bottom of the parent
110-
/// container, displacing in-flow content. They are always placed in the
111-
/// in-flow order relative to each other, as well as before any content
112-
/// following a later [`place.flush`] element.
93+
/// フロートの要素は流れの中にあるコンテンツをずらして親コンテナの上部または下部に位置取ります。
94+
///
95+
/// それらは常に互いのフロー内での順序を保ち、後続の[`place.flush`]要素に続くコンテンツより前に配置されます。
11396
///
11497
/// ```example
11598
/// #set page(height: 150pt)
@@ -129,15 +112,15 @@ pub struct PlaceElem {
129112
/// ```
130113
pub float: bool,
131114

132-
/// The spacing between the placed element and other elements in a floating
133-
/// layout.
115+
/// フロートレイアウトでの配置された要素と他の要素との間隔。
134116
///
135-
/// Has no effect if `float` is `{false}`.
117+
/// `float`が`{false}`の場合は影響がありません。
118+
136119
#[default(Em::new(1.5).into())]
137120
#[resolve]
138121
pub clearance: Length,
139122

140-
/// The horizontal displacement of the placed content.
123+
/// 配置したコンテンツの水平方向の変位。
141124
///
142125
/// ```example
143126
/// #set page(height: 100pt)
@@ -147,19 +130,17 @@ pub struct PlaceElem {
147130
/// }
148131
/// ```
149132
///
150-
/// This does not affect the layout of in-flow content.
151-
/// In other words, the placed content is treated as if it
152-
/// were wrapped in a [`move`] element.
133+
/// これは流れの中のコンテンツのレイアウトには影響しません。
134+
/// 言い換えると、配置されたコンテンツは[`move`]要素にラップされたかのように扱われます。
153135
pub dx: Rel<Length>,
154136

155-
/// The vertical displacement of the placed content.
137+
/// 配置したコンテンツの垂直方向の変位。
156138
///
157-
/// This does not affect the layout of in-flow content.
158-
/// In other words, the placed content is treated as if it
159-
/// were wrapped in a [`move`] element.
139+
/// これは流れの中のコンテンツのレイアウトには影響しません。
140+
/// 言い換えると、配置されたコンテンツは[`move`]要素にラップされたかのように扱われます。
160141
pub dy: Rel<Length>,
161142

162-
/// The content to place.
143+
/// 配置するコンテンツ。
163144
#[required]
164145
pub body: Content,
165146
}
@@ -184,11 +165,9 @@ pub enum PlacementScope {
184165
Parent,
185166
}
186167

187-
/// Asks the layout algorithm to place pending floating elements before
188-
/// continuing with the content.
168+
/// コンテンツの続行前に保留中のフロート要素を配置するようレイアウトアルゴリズムに指示。
189169
///
190-
/// This is useful for preventing floating figures from spilling
191-
/// into the next section.
170+
/// これは、次のセクションにフロートの図表が流れ込むのを防ぐのに便利です。
192171
///
193172
/// ```example
194173
/// >>> #set page(height: 160pt, width: 150pt)

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"/docs/reference/layout/pad/": "untranslated",
120120
"/docs/reference/layout/page/": "untranslated",
121121
"/docs/reference/layout/pagebreak/": "untranslated",
122-
"/docs/reference/layout/place/": "untranslated",
122+
"/docs/reference/layout/place/": "translated",
123123
"/docs/reference/layout/ratio/": "untranslated",
124124
"/docs/reference/layout/relative/": "untranslated",
125125
"/docs/reference/layout/repeat/": "untranslated",

0 commit comments

Comments
 (0)