From 6a43613dc1c02518cded8097c8faa00f530f01f8 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sat, 14 Jun 2025 23:48:34 +0900 Subject: [PATCH 1/4] =?UTF-8?q?`/docs/reference/data-loading/json/`?= =?UTF-8?q?=E3=81=AE=E7=BF=BB=E8=A8=B3=E9=96=8B=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/translation-status.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/translation-status.json b/website/translation-status.json index 84b1f14c2f..70cc17bc64 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -154,7 +154,7 @@ "/docs/reference/data-loading/": "untranslated", "/docs/reference/data-loading/cbor/": "untranslated", "/docs/reference/data-loading/csv/": "untranslated", - "/docs/reference/data-loading/json/": "untranslated", + "/docs/reference/data-loading/json/": "translated", "/docs/reference/data-loading/read/": "untranslated", "/docs/reference/data-loading/toml/": "untranslated", "/docs/reference/data-loading/xml/": "untranslated", From 0de4e995f75fa4bfe821dda747baf7ef84e756b0 Mon Sep 17 00:00:00 2001 From: gomazarashi Date: Sun, 15 Jun 2025 11:13:43 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/loading/json.rs | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/typst-library/src/loading/json.rs b/crates/typst-library/src/loading/json.rs index aa908cca4c..cb1a61a8ad 100644 --- a/crates/typst-library/src/loading/json.rs +++ b/crates/typst-library/src/loading/json.rs @@ -6,25 +6,25 @@ use crate::engine::Engine; use crate::foundations::{func, scope, Str, Value}; use crate::loading::{DataSource, Load, Readable}; -/// Reads structured data from a JSON file. +/// JSONファイルから構造化データを読み込む。 /// -/// The file must contain a valid JSON value, such as object or array. JSON -/// objects will be converted into Typst dictionaries, and JSON arrays will be -/// converted into Typst arrays. Strings and booleans will be converted into the -/// Typst equivalents, `null` will be converted into `{none}`, and numbers will -/// be converted to floats or integers depending on whether they are whole -/// numbers. +/// ファイルにはオブジェクトや配列などの有効なJSON値が含まれていなければなりません。 +/// JSONオブジェクトはTypstの辞書に変換され、 +/// JSON配列はTypstの配列に変換されます。 +/// 文字列やブール値はTypstの対応する値に変換され、`null`は`{none}`に、 +/// 数値は整数であれば整数に、 +/// そうでなければ浮動小数点数に変換されます。 /// -/// Be aware that integers larger than 263-1 will be converted to -/// floating point numbers, which may result in an approximative value. +/// 263-1より大きな整数は浮動小数点数に変換されるため、 +/// 近似値になる可能性があることに留意してください。 /// -/// The function returns a dictionary, an array or, depending on the JSON file, -/// another JSON data type. +/// この関数は、辞書、配列、 +/// あるいはJSONファイルの内容に応じてその他のJSONデータ型を返します。 /// -/// The JSON files in the example contain objects with the keys `temperature`, -/// `unit`, and `weather`. +/// この例におけるJSONファイルは、 +/// `temperature`、`unit`、および`weather`というキーを持つオブジェクトを含んでいます。 /// -/// # Example +/// # 例 /// ```example /// #let forecast(day) = block[ /// #box(square( @@ -51,7 +51,7 @@ use crate::loading::{DataSource, Load, Readable}; #[func(scope, title = "JSON")] pub fn json( engine: &mut Engine, - /// A [path]($syntax/#paths) to a JSON file or raw JSON bytes. + /// JSONファイルへの[パス]($syntax/#paths)、または生のJSONバイト列。 source: Spanned, ) -> SourceResult { let data = source.load(engine.world)?; @@ -62,23 +62,23 @@ pub fn json( #[scope] impl json { - /// Reads structured data from a JSON string/bytes. + /// JSONの文字列やバイト列から構造化データを読み込む。 #[func(title = "Decode JSON")] - #[deprecated = "`json.decode` is deprecated, directly pass bytes to `json` instead"] + #[deprecated = "`json.decode`は非推奨です。代わりにバイト列を直接`json`に渡してください。"] pub fn decode( engine: &mut Engine, - /// JSON data. + /// JSONデータ。 data: Spanned, ) -> SourceResult { json(engine, data.map(Readable::into_source)) } - /// Encodes structured data into a JSON string. + /// 構造化データをJSON文字列にエンコードする。 #[func(title = "Encode JSON")] pub fn encode( - /// Value to be encoded. + /// エンコード対象の値。 value: Spanned, - /// Whether to pretty print the JSON with newlines and indentation. + /// JSONを改行およびインデント付きで整形表示するかどうか。 #[named] #[default(true)] pretty: bool, From b058c0751e1c8941333104d04b765ecc376e96d4 Mon Sep 17 00:00:00 2001 From: gomazarashi <60730277+gomazarashi@users.noreply.github.com> Date: Mon, 16 Jun 2025 00:58:13 +0900 Subject: [PATCH 3/4] =?UTF-8?q?The=20file=E3=81=AB=E9=96=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E8=A1=A8=E7=8F=BE=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Shunsuke KIMURA --- crates/typst-library/src/loading/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/loading/json.rs b/crates/typst-library/src/loading/json.rs index cb1a61a8ad..b80e678445 100644 --- a/crates/typst-library/src/loading/json.rs +++ b/crates/typst-library/src/loading/json.rs @@ -8,7 +8,7 @@ use crate::loading::{DataSource, Load, Readable}; /// JSONファイルから構造化データを読み込む。 /// -/// ファイルにはオブジェクトや配列などの有効なJSON値が含まれていなければなりません。 +/// 読み込むファイルにはオブジェクトや配列などの有効なJSON値が含まれていなければなりません。 /// JSONオブジェクトはTypstの辞書に変換され、 /// JSON配列はTypstの配列に変換されます。 /// 文字列やブール値はTypstの対応する値に変換され、`null`は`{none}`に、 From e8460736df3ee2a2cd6384c05a67776b7db23390 Mon Sep 17 00:00:00 2001 From: gomazarashi <60730277+gomazarashi@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:55:07 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=82=92=E6=94=B9?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> --- crates/typst-library/src/loading/json.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/typst-library/src/loading/json.rs b/crates/typst-library/src/loading/json.rs index b80e678445..c774e35345 100644 --- a/crates/typst-library/src/loading/json.rs +++ b/crates/typst-library/src/loading/json.rs @@ -12,8 +12,8 @@ use crate::loading::{DataSource, Load, Readable}; /// JSONオブジェクトはTypstの辞書に変換され、 /// JSON配列はTypstの配列に変換されます。 /// 文字列やブール値はTypstの対応する値に変換され、`null`は`{none}`に、 -/// 数値は整数であれば整数に、 -/// そうでなければ浮動小数点数に変換されます。 +/// 数値は整数値であれば整数型に、 +/// そうでなければ浮動小数点数型に変換されます。 /// /// 263-1より大きな整数は浮動小数点数に変換されるため、 /// 近似値になる可能性があることに留意してください。