Skip to content

Commit 926e2df

Browse files
authored
Merge branch 'typst-jp:main' into translate/pdf
2 parents b830bd2 + 739d975 commit 926e2df

File tree

11 files changed

+142
-191
lines changed

11 files changed

+142
-191
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::loading::{DataSource, Load};
1010
///
1111
/// 読み込むファイルには有効なCBORによるシリアル化データが含まれていなければなりません。
1212
/// マッピングはTypstの辞書に変換され、シーケンスはTypstの配列に変換されます。
13-
/// 文字列やブール値はTypstの対応する値に変換され
13+
/// 文字列やブール値はTypstの対応する型に変換され
1414
/// ヌル値(`null`、`~`、または空の``)は`{none}`に、
1515
/// 数値は整数値であれば整数型に、
1616
/// そうでなければ浮動小数点数型に変換されます。
@@ -20,7 +20,7 @@ use crate::loading::{DataSource, Load};
2020
#[func(scope, title = "CBOR")]
2121
pub fn cbor(
2222
engine: &mut Engine,
23-
/// CBORファイルへの[パス]($syntax/#paths)、または生のCBORバイト列。
23+
/// CBORファイルの[パス]($syntax/#paths)、または生のCBORバイト列。
2424
source: Spanned<DataSource>,
2525
) -> SourceResult<Value> {
2626
let data = source.load(engine.world)?;

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
}

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

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

9-
/// Reads structured data from a TOML file.
9+
/// TOMLファイルから構造化データを読み込む。
1010
///
11-
/// The file must contain a valid TOML table. TOML tables will be converted into
12-
/// Typst dictionaries, and TOML arrays will be converted into Typst arrays.
13-
/// Strings, booleans and datetimes will be converted into the Typst equivalents
14-
/// and numbers will be converted to floats or integers depending on whether
15-
/// they are whole numbers.
11+
/// 読み込むファイルには有効なTOMLテーブルが含まれていなければなりません。
12+
/// TOMLテーブルはTypstの辞書に変換され、
13+
/// TOML配列はTypstの配列に変換されます。
14+
/// 文字列、ブール値、日時はTypstの対応する型に変換され、
15+
/// 数値は整数値であれば整数型に、そうでなければ浮動小数点数型に変換されます。
1616
///
17-
/// The TOML file in the example consists of a table with the keys `title`,
18-
/// `version`, and `authors`.
17+
/// この例におけるTOMLファイルは、
18+
/// `title`、`version`、および`authors`のキーを持つテーブルで構成されています。
1919
///
20-
/// # Example
20+
/// #
2121
/// ```example
2222
/// #let details = toml("details.toml")
2323
///
@@ -29,7 +29,7 @@ use crate::loading::{DataSource, Load, Readable};
2929
#[func(scope, title = "TOML")]
3030
pub fn toml(
3131
engine: &mut Engine,
32-
/// A [path]($syntax/#paths) to a TOML file or raw TOML bytes.
32+
/// TOMLファイルの[パス]($syntax/#paths)、または生のTOMLバイト列。
3333
source: Spanned<DataSource>,
3434
) -> SourceResult<Value> {
3535
let data = source.load(engine.world)?;
@@ -41,23 +41,23 @@ pub fn toml(
4141

4242
#[scope]
4343
impl toml {
44-
/// Reads structured data from a TOML string/bytes.
44+
/// TOMLの文字列やバイト列から構造化データを読み込む。
4545
#[func(title = "Decode TOML")]
46-
#[deprecated = "`toml.decode` is deprecated, directly pass bytes to `toml` instead"]
46+
#[deprecated = "`toml.decode`は非推奨です。代わりにバイト列を直接`toml`に渡してください。"]
4747
pub fn decode(
4848
engine: &mut Engine,
49-
/// TOML data.
49+
/// TOMLデータ。
5050
data: Spanned<Readable>,
5151
) -> SourceResult<Value> {
5252
toml(engine, data.map(Readable::into_source))
5353
}
5454

55-
/// Encodes structured data into a TOML string.
55+
/// 構造化データをTOML文字列にエンコードする。
5656
#[func(title = "Encode TOML")]
5757
pub fn encode(
58-
/// Value to be encoded.
58+
/// エンコード対象の値。
5959
value: Spanned<Value>,
60-
/// Whether to pretty-print the resulting TOML.
60+
/// TOMLを整形表示するかどうか。
6161
#[named]
6262
#[default(true)]
6363
pretty: bool,

crates/typst-library/src/math/attach.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,12 @@ pub struct LimitsElem {
124124
pub inline: bool,
125125
}
126126

127-
/// Stretches a glyph.
127+
/// 字形を伸縮します。
128128
///
129-
/// This function can also be used to automatically stretch the base of an
130-
/// attachment, so that it fits the top and bottom attachments.
129+
/// この関数は、上部及び下部アタッチメントがフィットするように、自動的にアタッチメントのベースを伸縮させることにも使えます。
131130
///
132-
/// Note that only some glyphs can be stretched, and which ones can depend on
133-
/// the math font being used. However, most math fonts are the same in this
134-
/// regard.
131+
/// 伸縮可能な字形は限られており、どの字形が伸縮可能かは使用する数式フォントに依存することに注意してください。
132+
/// ただし、この点に関して多くの数式フォントで違いはありません。
135133
///
136134
/// ```example
137135
/// $ H stretch(=)^"define" U + p V $
@@ -141,12 +139,11 @@ pub struct LimitsElem {
141139
/// ```
142140
#[elem(Mathy)]
143141
pub struct StretchElem {
144-
/// The glyph to stretch.
142+
/// 伸縮させる字形。
145143
#[required]
146144
pub body: Content,
147145

148-
/// The size to stretch to, relative to the maximum size of the glyph and
149-
/// its attachments.
146+
/// 字形およびそのアタッチメントを基準とした伸縮の大きさ。
150147
#[resolve]
151148
#[default(Rel::one())]
152149
pub size: Rel<Length>,

0 commit comments

Comments
 (0)