Skip to content

Commit 1d8da01

Browse files
authored
Merge branch 'main' into translate-math/styles
2 parents 667cf0b + 739d975 commit 1d8da01

35 files changed

+624
-743
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 貢献ガイドライン
22

33
> [!NOTE]
4-
> 当プロジェクトの[README](./README.md)や「[はじめに:Typst Japan Communityより](https://typst-jp.github.io/docs/)」、[Typst公式](https://typst.app/)[ライセンス](https://github.com/typst/typst/blob/main/LICENSE)[コントリビューション・ガイド](https://github.com/typst/typst/blob/main/CONTRIBUTING.md)も併せてご参照ください。
4+
> 当プロジェクトの[README](./README.md)や「[はじめに:Typst Japanese Communityより](https://typst-jp.github.io/docs/)」、[Typst公式](https://typst.app/)[ライセンス](https://github.com/typst/typst/blob/main/LICENSE)[コントリビューション・ガイド](https://github.com/typst/typst/blob/main/CONTRIBUTING.md)も併せてご参照ください。
55
66
Typst日本語ドキュメント翻訳プロジェクトにご興味をお持ちいただき、どうもありがとうございます。
77

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
}

crates/typst-library/src/loading/cbor.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ use crate::engine::Engine;
66
use crate::foundations::{func, scope, Bytes, Value};
77
use crate::loading::{DataSource, Load};
88

9-
/// Reads structured data from a CBOR file.
9+
/// CBORファイルから構造化データを読み込む。
1010
///
11-
/// The file must contain a valid CBOR serialization. Mappings will be
12-
/// converted into Typst dictionaries, and sequences will be converted into
13-
/// Typst arrays. Strings and booleans will be converted into the Typst
14-
/// equivalents, null-values (`null`, `~` or empty ``) will be converted into
15-
/// `{none}`, and numbers will be converted to floats or integers depending on
16-
/// whether they are whole numbers.
11+
/// 読み込むファイルには有効なCBORによるシリアル化データが含まれていなければなりません。
12+
/// マッピングはTypstの辞書に変換され、シーケンスはTypstの配列に変換されます。
13+
/// 文字列やブール値はTypstの対応する型に変換され、
14+
/// ヌル値(`null``~`、または空の``)は`{none}`に、
15+
/// 数値は整数値であれば整数型に、
16+
/// そうでなければ浮動小数点数型に変換されます。
1717
///
18-
/// Be aware that integers larger than 2<sup>63</sup>-1 will be converted to
19-
/// floating point numbers, which may result in an approximative value.
18+
/// 2<sup>63</sup>-1より大きな整数は浮動小数点数に変換されるため、
19+
/// 近似値になる可能性があることに留意してください。
2020
#[func(scope, title = "CBOR")]
2121
pub fn cbor(
2222
engine: &mut Engine,
23-
/// A [path]($syntax/#paths) to a CBOR file or raw CBOR bytes.
23+
/// CBORファイルの[パス]($syntax/#paths)、または生のCBORバイト列。
2424
source: Spanned<DataSource>,
2525
) -> SourceResult<Value> {
2626
let data = source.load(engine.world)?;
@@ -31,21 +31,21 @@ pub fn cbor(
3131

3232
#[scope]
3333
impl cbor {
34-
/// Reads structured data from CBOR bytes.
34+
/// CBORバイト列から構造化データを読み込む。
3535
#[func(title = "Decode CBOR")]
36-
#[deprecated = "`cbor.decode` is deprecated, directly pass bytes to `cbor` instead"]
36+
#[deprecated = "`cbor.decode`は非推奨です。代わりにバイト列を直接`cbor`に渡してください。"]
3737
pub fn decode(
3838
engine: &mut Engine,
39-
/// CBOR data.
39+
/// CBORデータ。
4040
data: Spanned<Bytes>,
4141
) -> SourceResult<Value> {
4242
cbor(engine, data.map(DataSource::Bytes))
4343
}
4444

45-
/// Encode structured data into CBOR bytes.
45+
/// 構造化データをCBORバイト列にエンコードする。
4646
#[func(title = "Encode CBOR")]
4747
pub fn encode(
48-
/// Value to be encoded.
48+
/// エンコード対象の値。
4949
value: Spanned<Value>,
5050
) -> SourceResult<Bytes> {
5151
let Spanned { v: value, span } = value;

crates/typst-library/src/loading/csv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::loading::{DataSource, Load, Readable};
2626
#[func(scope, title = "CSV")]
2727
pub fn csv(
2828
engine: &mut Engine,
29-
/// CSVファイルへの[パス]($syntax/#paths)、または生のCSVバイト列。
29+
/// CSVファイルの[パス]($syntax/#paths)、または生のCSVバイト列。
3030
source: Spanned<DataSource>,
3131
/// CSVファイルの列を区切る区切り文字。
3232
/// 単一のASCII文字でなければなりません。

crates/typst-library/src/loading/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::loading::{DataSource, Load, Readable};
1111
/// 読み込むファイルにはオブジェクトや配列などの有効なJSON値が含まれていなければなりません。
1212
/// JSONオブジェクトはTypstの辞書に変換され、
1313
/// JSON配列はTypstの配列に変換されます。
14-
/// 文字列やブール値はTypstの対応する値に変換され、`null`は`{none}`に、
14+
/// 文字列やブール値はTypstの対応する型に変換され、`null`は`{none}`に、
1515
/// 数値は整数値であれば整数型に、
1616
/// そうでなければ浮動小数点数型に変換されます。
1717
///
@@ -51,7 +51,7 @@ use crate::loading::{DataSource, Load, Readable};
5151
#[func(scope, title = "JSON")]
5252
pub fn json(
5353
engine: &mut Engine,
54-
/// JSONファイルへの[パス]($syntax/#paths)、または生のJSONバイト列。
54+
/// JSONファイルの[パス]($syntax/#paths)、または生のJSONバイト列。
5555
source: Spanned<DataSource>,
5656
) -> SourceResult<Value> {
5757
let data = source.load(engine.world)?;

crates/typst-library/src/loading/read.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use crate::foundations::{func, Cast};
77
use crate::loading::Readable;
88
use crate::World;
99

10-
/// Reads plain text or data from a file.
10+
/// ファイルからプレーンテキストやデータを読み込む。
1111
///
12-
/// By default, the file will be read as UTF-8 and returned as a [string]($str).
12+
/// デフォルトでは、ファイルはUTF-8として読み込まれ、[文字列]($str)として返されます。
1313
///
14-
/// If you specify `{encoding: none}`, this returns raw [bytes] instead.
14+
/// `{encoding: none}`を指定した場合、この関数は代わりに生の[bytes]を返します。
1515
///
16-
/// # Example
16+
/// #
1717
/// ```example
1818
/// An example for a HTML file: \
1919
/// #let text = read("example.html")
@@ -25,13 +25,13 @@ use crate::World;
2525
#[func]
2626
pub fn read(
2727
engine: &mut Engine,
28-
/// Path to a file.
28+
/// ファイルのパス。
2929
///
30-
/// For more details, see the [Paths section]($syntax/#paths).
30+
/// 詳細については、[パスのセクション]($syntax/#paths)を参照してください。
3131
path: Spanned<EcoString>,
32-
/// The encoding to read the file with.
32+
/// ファイルを読み込む際に使用するエンコーディング。
3333
///
34-
/// If set to `{none}`, this function returns raw bytes.
34+
/// `{none}`に設定すると、この関数は生のバイトを返します。
3535
#[named]
3636
#[default(Some(Encoding::Utf8))]
3737
encoding: Option<Encoding>,
@@ -47,9 +47,9 @@ pub fn read(
4747
})
4848
}
4949

50-
/// An encoding of a file.
50+
/// ファイルのエンコーディング。
5151
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)]
5252
pub enum Encoding {
53-
/// The Unicode UTF-8 encoding.
53+
/// Unicode UTF-8エンコーディング。
5454
Utf8,
5555
}

0 commit comments

Comments
 (0)