Skip to content

Commit cf45798

Browse files
/docs/reference/layout/moveおよび/docs/reference/layout/rotateおよび/docs/reference/layout/scaleおよび/docs/reference/layout/skewの翻訳 (#222)
Co-authored-by: Shunsuke KIMURA <[email protected]>
1 parent b1e96d5 commit cf45798

File tree

2 files changed

+48
-55
lines changed

2 files changed

+48
-55
lines changed

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

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ use crate::layout::{
77
Abs, Alignment, Angle, BlockElem, HAlignment, Length, Ratio, Rel, VAlignment,
88
};
99

10-
/// Moves content without affecting layout.
10+
/// レイアウトに影響を与えないコンテンツの移動。
1111
///
12-
/// The `move` function allows you to move content while the layout still 'sees'
13-
/// it at the original positions. Containers will still be sized as if the
14-
/// content was not moved.
12+
/// `move`関数を用いると、コンテンツの元々の位置をレイアウトに「認識」させながら、そのコンテンツを移動させることができます。
13+
/// コンテナの大きさは、コンテンツが移動されていないかのように決定されます。
1514
///
16-
/// # Example
15+
/// #
1716
/// ```example
1817
/// #rect(inset: 0pt, move(
1918
/// dx: 6pt, dy: 6pt,
@@ -27,13 +26,13 @@ use crate::layout::{
2726
/// ```
2827
#[elem(Show)]
2928
pub struct MoveElem {
30-
/// The horizontal displacement of the content.
29+
/// コンテンツの水平方向の変位。
3130
pub dx: Rel<Length>,
3231

33-
/// The vertical displacement of the content.
32+
/// コンテンツの垂直方向の変位。
3433
pub dy: Rel<Length>,
3534

36-
/// The content to move.
35+
/// 移動させたいコンテンツ。
3736
#[required]
3837
pub body: Content,
3938
}
@@ -46,12 +45,12 @@ impl Show for Packed<MoveElem> {
4645
}
4746
}
4847

49-
/// Rotates content without affecting layout.
48+
/// レイアウトに影響を与えないコンテンツの回転。
5049
///
51-
/// Rotates an element by a given angle. The layout will act as if the element
52-
/// was not rotated unless you specify `{reflow: true}`.
50+
/// 要素を指定された角度だけ回転させます。
51+
/// `{reflow: true}`を指定しない限り、レイアウトは、その要素が回転していないかのように振る舞います。
5352
///
54-
/// # Example
53+
/// #
5554
/// ```example
5655
/// #stack(
5756
/// dir: ltr,
@@ -62,7 +61,7 @@ impl Show for Packed<MoveElem> {
6261
/// ```
6362
#[elem(Show)]
6463
pub struct RotateElem {
65-
/// The amount of rotation.
64+
/// 回転させる量。
6665
///
6766
/// ```example
6867
/// #rotate(-1.571rad)[Space!]
@@ -71,11 +70,9 @@ pub struct RotateElem {
7170
#[positional]
7271
pub angle: Angle,
7372

74-
/// The origin of the rotation.
73+
/// 回転の中心点。
7574
///
76-
/// If, for instance, you wanted the bottom left corner of the rotated
77-
/// element to stay aligned with the baseline, you would set it to `bottom +
78-
/// left` instead.
75+
/// 例えば、回転した要素の左下隅をベースラインに揃えたままにしたい場合、代わりに`bottom + left`を指定します。
7976
///
8077
/// ```example
8178
/// #set text(spacing: 8pt)
@@ -90,19 +87,18 @@ pub struct RotateElem {
9087
#[default(HAlignment::Center + VAlignment::Horizon)]
9188
pub origin: Alignment,
9289

93-
/// Whether the rotation impacts the layout.
90+
/// 回転がレイアウトに影響を与えるかどうか。
9491
///
95-
/// If set to `{false}`, the rotated content will retain the bounding box of
96-
/// the original content. If set to `{true}`, the bounding box will take the
97-
/// rotation of the content into account and adjust the layout accordingly.
92+
/// `{false}`に設定された場合、回転したコンテンツは元々のコンテンツのバウンディングボックスに留まります。
93+
/// `{true}`に設定された場合、バウンディングボックスはコンテンツの回転を考慮してレイアウトを調整します。
9894
///
9995
/// ```example
10096
/// Hello #rotate(90deg, reflow: true)[World]!
10197
/// ```
10298
#[default(false)]
10399
pub reflow: bool,
104100

105-
/// The content to rotate.
101+
/// 回転させるコンテンツ。
106102
#[required]
107103
pub body: Content,
108104
}
@@ -115,44 +111,43 @@ impl Show for Packed<RotateElem> {
115111
}
116112
}
117113

118-
/// Scales content without affecting layout.
114+
/// レイアウトに影響を与えないコンテンツの拡大縮小。
119115
///
120-
/// Lets you mirror content by specifying a negative scale on a single axis.
116+
/// 単一の軸で負のスケールを指定することで、コンテンツを反転表示できます。
121117
///
122-
/// # Example
118+
/// #
123119
/// ```example
124120
/// #set align(center)
125121
/// #scale(x: -100%)[This is mirrored.]
126122
/// #scale(x: -100%, reflow: true)[This is mirrored.]
127123
/// ```
128124
#[elem(Show)]
129125
pub struct ScaleElem {
130-
/// The scaling factor for both axes, as a positional argument. This is just
131-
/// an optional shorthand notation for setting `x` and `y` to the same
132-
/// value.
126+
/// 位置引数として両方の軸の拡大縮小率を設定します。
127+
/// これは`x`と`y`を同じ値で設定する省略記法です。
133128
#[external]
134129
#[positional]
135130
#[default(Smart::Custom(ScaleAmount::Ratio(Ratio::one())))]
136131
pub factor: Smart<ScaleAmount>,
137132

138-
/// The horizontal scaling factor.
133+
/// 水平方向の拡大縮小率。
139134
///
140-
/// The body will be mirrored horizontally if the parameter is negative.
135+
/// 負の値が指定された場合は本文が水平方向に反転します。
141136
#[parse(
142137
let all = args.find()?;
143138
args.named("x")?.or(all)
144139
)]
145140
#[default(Smart::Custom(ScaleAmount::Ratio(Ratio::one())))]
146141
pub x: Smart<ScaleAmount>,
147142

148-
/// The vertical scaling factor.
143+
/// 垂直方向の拡大縮小率。
149144
///
150-
/// The body will be mirrored vertically if the parameter is negative.
145+
/// 負の値が指定された場合は本文が垂直方向に反転します。
151146
#[parse(args.named("y")?.or(all))]
152147
#[default(Smart::Custom(ScaleAmount::Ratio(Ratio::one())))]
153148
pub y: Smart<ScaleAmount>,
154149

155-
/// The origin of the transformation.
150+
/// 変換の原点。
156151
///
157152
/// ```example
158153
/// A#box(scale(75%)[A])A \
@@ -162,19 +157,18 @@ pub struct ScaleElem {
162157
#[default(HAlignment::Center + VAlignment::Horizon)]
163158
pub origin: Alignment,
164159

165-
/// Whether the scaling impacts the layout.
160+
/// 拡大縮小がレイアウトに影響を与えるかどうか。
166161
///
167-
/// If set to `{false}`, the scaled content will be allowed to overlap
168-
/// other content. If set to `{true}`, it will compute the new size of
169-
/// the scaled content and adjust the layout accordingly.
162+
/// `{false}`の場合、拡大縮小したコンテンツが他のコンテンツと重なることを許可します。
163+
/// `{true}`の場合、拡大縮小したコンテンツの新しい大きさを計算し、それに応じてレイアウトを調整します。
170164
///
171165
/// ```example
172166
/// Hello #scale(x: 20%, y: 40%, reflow: true)[World]!
173167
/// ```
174168
#[default(false)]
175169
pub reflow: bool,
176170

177-
/// The content to scale.
171+
/// 拡大縮小するコンテンツ。
178172
#[required]
179173
pub body: Content,
180174
}
@@ -204,20 +198,20 @@ cast! {
204198
length: Length => ScaleAmount::Length(length),
205199
}
206200

207-
/// Skews content.
201+
/// コンテンツのスキュー変形。
208202
///
209-
/// Skews an element in horizontal and/or vertical direction. The layout will
210-
/// act as if the element was not skewed unless you specify `{reflow: true}`.
203+
/// 水平方向または垂直方向、あるいは両方向に要素をスキュー(シアー)変形します。
204+
/// `{reflow: true}`を指定しない限り、レイアウトは要素がスキュー変形を受けていないかのように振る舞います。
211205
///
212-
/// # Example
206+
/// #
213207
/// ```example
214208
/// #skew(ax: -12deg)[
215209
/// This is some fake italic text.
216210
/// ]
217211
/// ```
218212
#[elem(Show)]
219213
pub struct SkewElem {
220-
/// The horizontal skewing angle.
214+
/// 水平方向のスキュー角。
221215
///
222216
/// ```example
223217
/// #skew(ax: 30deg)[Skewed]
@@ -226,7 +220,7 @@ pub struct SkewElem {
226220
#[default(Angle::zero())]
227221
pub ax: Angle,
228222

229-
/// The vertical skewing angle.
223+
/// 垂直方向のスキュー角。
230224
///
231225
/// ```example
232226
/// #skew(ay: 30deg)[Skewed]
@@ -235,9 +229,9 @@ pub struct SkewElem {
235229
#[default(Angle::zero())]
236230
pub ay: Angle,
237231

238-
/// The origin of the skew transformation.
232+
/// スキュー変形の原点。
239233
///
240-
/// The origin will stay fixed during the operation.
234+
/// 操作中は原点が固定されます。
241235
///
242236
/// ```example
243237
/// X #box(skew(ax: -30deg, origin: center + horizon)[X]) X \
@@ -248,19 +242,18 @@ pub struct SkewElem {
248242
#[default(HAlignment::Center + VAlignment::Horizon)]
249243
pub origin: Alignment,
250244

251-
/// Whether the skew transformation impacts the layout.
245+
/// スキュー変形がレイアウトに影響を与えるかどうか。
252246
///
253-
/// If set to `{false}`, the skewed content will retain the bounding box of
254-
/// the original content. If set to `{true}`, the bounding box will take the
255-
/// transformation of the content into account and adjust the layout accordingly.
247+
/// `{false}`の場合、スキュー変形されたコンテンツは元々のコンテンツのバウンディングボックスに留まります。
248+
/// `{true}`の場合、バウンディングボックスはコンテンツの変形を考慮してレイアウトを調整します。
256249
///
257250
/// ```example
258251
/// Hello #skew(ay: 30deg, reflow: true, "World")!
259252
/// ```
260253
#[default(false)]
261254
pub reflow: bool,
262255

263-
/// The content to skew.
256+
/// スキュー変形するコンテンツ。
264257
#[required]
265258
pub body: Content,
266259
}

website/translation-status.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,17 @@
115115
"/docs/reference/layout/layout/": "translated",
116116
"/docs/reference/layout/length/": "translated",
117117
"/docs/reference/layout/measure/": "translated",
118-
"/docs/reference/layout/move/": "untranslated",
118+
"/docs/reference/layout/move/": "translated",
119119
"/docs/reference/layout/pad/": "translated",
120120
"/docs/reference/layout/page/": "translated",
121121
"/docs/reference/layout/pagebreak/": "translated",
122122
"/docs/reference/layout/place/": "translated",
123123
"/docs/reference/layout/ratio/": "translated",
124124
"/docs/reference/layout/relative/": "translated",
125125
"/docs/reference/layout/repeat/": "translated",
126-
"/docs/reference/layout/rotate/": "untranslated",
127-
"/docs/reference/layout/scale/": "untranslated",
128-
"/docs/reference/layout/skew/": "untranslated",
126+
"/docs/reference/layout/rotate/": "translated",
127+
"/docs/reference/layout/scale/": "translated",
128+
"/docs/reference/layout/skew/": "translated",
129129
"/docs/reference/layout/h/": "translated",
130130
"/docs/reference/layout/v/": "translated",
131131
"/docs/reference/layout/stack/": "translated",

0 commit comments

Comments
 (0)