Skip to content

Commit ea5f34d

Browse files
committed
翻訳完了
1 parent e50a89e commit ea5f34d

File tree

1 file changed

+15
-15
lines changed
  • crates/typst-library/src/loading

1 file changed

+15
-15
lines changed

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;

0 commit comments

Comments
 (0)