Skip to content

Commit 6d5e908

Browse files
committed
Translate model-numbering
Signed-off-by: Shunsuke Kimura <[email protected]>
1 parent d948874 commit 6d5e908

File tree

2 files changed

+28
-39
lines changed

2 files changed

+28
-39
lines changed

crates/typst-library/src/model/numbering.rs

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ use crate::engine::Engine;
1111
use crate::foundations::{cast, func, Context, Func, Str, Value};
1212
use crate::text::Case;
1313

14-
/// Applies a numbering to a sequence of numbers.
14+
/// 順序に応じた番号付け。
1515
///
16-
/// A numbering defines how a sequence of numbers should be displayed as
17-
/// content. It is defined either through a pattern string or an arbitrary
18-
/// function.
16+
/// 番号付けは、一連の数値をコンテンツとしてどのように表示するかを定義します。
17+
/// これはパターン文字列または任意の関数によって指定されます。
1918
///
20-
/// A numbering pattern consists of counting symbols, for which the actual
21-
/// number is substituted, their prefixes, and one suffix. The prefixes and the
22-
/// suffix are repeated as-is.
19+
/// 番号付けパターンは、数値を置き換えるためのカウント記号、それらに付ける接頭辞、そして1つの接尾辞から構成されます。
20+
/// 接頭辞と接尾辞は、そのままの形で繰り返し使用されます。
2321
///
24-
/// # Example
22+
/// #
2523
/// ```example
2624
/// #numbering("1.1)", 1, 2, 3) \
2725
/// #numbering("1.a.i", 1, 2) \
@@ -35,15 +33,12 @@ use crate::text::Case;
3533
/// )
3634
/// ```
3735
///
38-
/// # Numbering patterns and numbering functions
39-
/// There are multiple instances where you can provide a numbering pattern or
40-
/// function in Typst. For example, when defining how to number
41-
/// [headings]($heading) or [figures]($figure). Every time, the expected format
42-
/// is the same as the one described below for the
43-
/// [`numbering`]($numbering.numbering) parameter.
36+
/// # 番号付けのパターン指定と関数指定
37+
/// Typstではパターン指定または関数指定で番号付けを定義できる場面がいくつかあります。
38+
/// たとえば、[見出し]($heading)や[図表]($figure)などに番号を付ける際に使用します。
39+
/// いずれの場合も、指定の形式は後述する[`numbering`]($numbering.numbering)パラメーターと同じです。
4440
///
45-
/// The following example illustrates that a numbering function is just a
46-
/// regular [function] that accepts numbers and returns [`content`].
41+
/// 次の例は、番号付け用の関数が、単に数値を受け取って[`content`]を返す通常の[function]であることを示しています。
4742
/// ```example
4843
/// #let unary(.., last) = "|" * last
4944
/// #set heading(numbering: unary)
@@ -55,35 +50,29 @@ use crate::text::Case;
5550
pub fn numbering(
5651
engine: &mut Engine,
5752
context: Tracked<Context>,
58-
/// Defines how the numbering works.
53+
/// 番号付けの表示形式を定義します。
5954
///
60-
/// **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `α`, `Α`, `一`, `壹`,
61-
/// `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `١`, `۱`, `१`, `১`, `ক`,
62-
/// `①`, and `⓵`. They are replaced by the number in the sequence,
63-
/// preserving the original case.
55+
/// **カウント記号** として使用できるパターン文字は `1`, `a`, `A`, `i`, `I`, `α`, `Α`, `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `١`, `۱`, `१`, `১`, `ক`, `①`, `⓵`があります。
56+
/// これらの文字は、大文字・小文字を維持したまま、対応する順序の番号文字に置き換えられます。
6457
///
65-
/// The `*` character means that symbols should be used to count, in the
66-
/// order of `*`, `†`, `‡`, `§`, `¶`, `‖`. If there are more than six
67-
/// items, the number is represented using repeated symbols.
58+
/// 記号`*`は `*`, `†`, `‡`, `§`, `¶`, `‖`の順序で番号付けすることを意味します。
59+
/// 項目が6つ以上ある場合は、記号を繰り返し使用して番号を表現します。
6860
///
69-
/// **Suffixes** are all characters after the last counting symbol. They are
70-
/// repeated as-is at the end of any rendered number.
61+
/// **接尾辞** とは、最後のカウント記号の後ろに置く文字列です。
62+
/// これらは、生成された番号文字の末尾にそのまま追加されます。
7163
///
72-
/// **Prefixes** are all characters that are neither counting symbols nor
73-
/// suffixes. They are repeated as-is at in front of their rendered
74-
/// equivalent of their counting symbol.
64+
/// **接頭辞** は、カウント記号でも接尾辞でもない文字列です。
65+
/// それぞれのカウント記号の前に、そのままの形で繰り返し表示されます。
7566
///
76-
/// This parameter can also be an arbitrary function that gets each number
77-
/// as an individual argument. When given a function, the `numbering`
78-
/// function just forwards the arguments to that function. While this is not
79-
/// particularly useful in itself, it means that you can just give arbitrary
67+
/// このパラメータには、数値を個別の引数として受け取る任意の関数も指定できます。
68+
/// 関数が与えられた場合、`numbering`関数はその引数をそのまま関数に渡します。
69+
/// これ自体は特に便利というわけではありませんが、番号付けがパターン指定であっても関数指定であっても、番号付けの定義を`numbering`関数に適用できるという意味を持ちます。
70+
8071
/// numberings to the `numbering` function without caring whether they are
81-
/// defined as a pattern or function.
8272
numbering: Numbering,
83-
/// The numbers to apply the numbering to. Must be positive.
84-
///
85-
/// If `numbering` is a pattern and more numbers than counting symbols are
86-
/// given, the last counting symbol with its prefix is repeated.
73+
/// 番号付けを適用する対象の数値。正の値としてください。
74+
///
75+
/// 番号付けがパターン形式であり、カウント記号よりも多くの数値が指定された場合、最後のカウント記号とその接頭辞が繰り返されます。
8776
#[variadic]
8877
numbers: Vec<usize>,
8978
) -> SourceResult<Value> {

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"/docs/reference/model/heading/": "translated",
5454
"/docs/reference/model/link/": "translated",
5555
"/docs/reference/model/enum/": "translated",
56-
"/docs/reference/model/numbering/": "untranslated",
56+
"/docs/reference/model/numbering/": "translated",
5757
"/docs/reference/model/outline/": "untranslated",
5858
"/docs/reference/model/par/": "translated",
5959
"/docs/reference/model/parbreak/": "translated",

0 commit comments

Comments
 (0)