Skip to content

Commit fb3a736

Browse files
ultimatilekimushun11013w36zj6
authored
/docs/reference/layout/measureの翻訳 (#213)
Co-authored-by: Shunsuke KIMURA <[email protected]> Co-authored-by: 3w36zj6 <[email protected]>
1 parent f588f0d commit fb3a736

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

crates/typst-library/src/layout/measure.rs

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ use crate::foundations::{dict, func, Content, Context, Dict, Resolve, Smart};
77
use crate::introspection::{Locator, LocatorLink};
88
use crate::layout::{Abs, Axes, Length, Region, Size};
99

10-
/// Measures the layouted size of content.
10+
/// レイアウトされたコンテンツの測定。
1111
///
12-
/// The `measure` function lets you determine the layouted size of content.
13-
/// By default an infinite space is assumed, so the measured dimensions may
14-
/// not necessarily match the final dimensions of the content.
15-
/// If you want to measure in the current layout dimensions, you can combine
16-
/// `measure` and [`layout`].
12+
/// `measure`関数を用いるとレイアウトされたコンテンツの大きさを測定できます。
13+
/// デフォルトでは無限のスペースが想定されているため、測定された寸法は必ずしもコンテンツの最終的な寸法に一致するとは限りません。
14+
/// 現在のレイアウトの寸法が測定したい場合は、`measure`と[`layout`]を組み合わせることができます。
1715
///
18-
/// # Example
19-
/// The same content can have a different size depending on the [context] that
20-
/// it is placed into. In the example below, the `[#content]` is of course
21-
/// bigger when we increase the font size.
16+
/// # 例
17+
/// 同じコンテンツでも置く場所の[context]によって異なる大きさになることがあります。
18+
/// 以下の例では、フォントサイズを大きくすると`[#content]`は必然的に大きくなります。
2219
///
2320
/// ```example
2421
/// #let content = [Hello!]
@@ -27,7 +24,7 @@ use crate::layout::{Abs, Axes, Length, Region, Size};
2724
/// #content
2825
/// ```
2926
///
30-
/// For this reason, you can only measure when context is available.
27+
/// この理由から、測定が可能なのはコンテキストが利用可能な場合に限ります。
3128
///
3229
/// ```example
3330
/// #let thing(body) = context {
@@ -39,21 +36,18 @@ use crate::layout::{Abs, Axes, Length, Region, Size};
3936
/// #thing[Welcome]
4037
/// ```
4138
///
42-
/// The measure function returns a dictionary with the entries `width` and
43-
/// `height`, both of type [`length`].
39+
/// measure関数はキーが`width`と`height`で、その値がいずれも[`length`]型の辞書を返します。
4440
#[func(contextual)]
4541
pub fn measure(
4642
engine: &mut Engine,
4743
context: Tracked<Context>,
4844
span: Span,
49-
/// The width available to layout the content.
45+
/// コンテンツをレイアウトするのに利用可能な幅。
5046
///
51-
/// Setting this to `{auto}` indicates infinite available width.
47+
/// これを`{auto}`に設定すると無限大の幅が利用可能であると見なされます。
5248
///
53-
/// Note that using the `width` and `height` parameters of this function is
54-
/// different from measuring a sized [`block`] containing the content. In
55-
/// the following example, the former will get the dimensions of the inner
56-
/// content instead of the dimensions of the block.
49+
/// この関数の`width`および`height`パラメーターを用いることは、大きさを持ち、コンテンツを有する[`block`]を測定することとは異なることに注意してください。
50+
/// 以下の例では、前者はブロックの寸法ではなく、内側のコンテンツの寸法を取得します。
5751
///
5852
/// ```example
5953
/// #context measure(lorem(100), width: 400pt)
@@ -63,13 +57,13 @@ pub fn measure(
6357
#[named]
6458
#[default(Smart::Auto)]
6559
width: Smart<Length>,
66-
/// The height available to layout the content.
60+
/// コンテンツをレイアウトするのに利用可能な高さ。
6761
///
68-
/// Setting this to `{auto}` indicates infinite available height.
62+
/// これを`{auto}`に設定すると無限大の高さが利用可能であると見なされます。
6963
#[named]
7064
#[default(Smart::Auto)]
7165
height: Smart<Length>,
72-
/// The content whose size to measure.
66+
/// 大きさを測定するコンテンツ。
7367
content: Content,
7468
) -> SourceResult<Dict> {
7569
// Create a pod region with the available space.

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"/docs/reference/layout/hide/": "translated",
115115
"/docs/reference/layout/layout/": "translated",
116116
"/docs/reference/layout/length/": "translated",
117-
"/docs/reference/layout/measure/": "untranslated",
117+
"/docs/reference/layout/measure/": "translated",
118118
"/docs/reference/layout/move/": "untranslated",
119119
"/docs/reference/layout/pad/": "translated",
120120
"/docs/reference/layout/page/": "translated",

0 commit comments

Comments
 (0)