From e2a68556711ea8138bdd91c826fc7841910dc18c Mon Sep 17 00:00:00 2001 From: ultimatile Date: Fri, 5 Sep 2025 05:50:06 +0900 Subject: [PATCH 1/5] =?UTF-8?q?`/docs/reference/introspection/locate`?= =?UTF-8?q?=E3=81=AE=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../typst-library/src/introspection/locate.rs | 23 ++++++++----------- website/translation-status.json | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index 50f217851a..28a9f3cf5d 100644 --- a/crates/typst-library/src/introspection/locate.rs +++ b/crates/typst-library/src/introspection/locate.rs @@ -5,15 +5,13 @@ use crate::engine::Engine; use crate::foundations::{func, Context, LocatableSelector}; use crate::introspection::Location; -/// Determines the location of an element in the document. +/// 文書中の要素の位置を特定。 /// -/// Takes a selector that must match exactly one element and returns that -/// element's [`location`]. This location can, in particular, be used to -/// retrieve the physical [`page`]($location.page) number and -/// [`position`]($location.position) (page, x, y) for that element. +/// 厳密に1つだけの要素にマッチしなければならないセレクターを受け取り、要素の[`location`]を返します。 +/// このlocationを用いると、特に、物理的な[`page`]($location.page)番号やその要素の[`position`]($location.position)(ページ番号、x座標、y座標)を取得できます。 /// -/// # Examples -/// Locating a specific element: +/// # 例 +/// 特定の要素の位置を特定します。 /// ```example /// #context [ /// Introduction is at: \ @@ -26,13 +24,12 @@ use crate::introspection::Location; pub fn locate( engine: &mut Engine, context: Tracked, - /// A selector that should match exactly one element. This element will be - /// located. + /// 厳密に1つだけの要素にマッチしなければならないセレクター。 + /// その要素の位置が決定されます。 /// - /// Especially useful in combination with - /// - [`here`] to locate the current context, - /// - a [`location`] retrieved from some queried element via the - /// [`location()`]($content.location) method on content. + /// 以下との組み合わせが特に便利です。 + /// - [`here`]と組み合わせた現在のコンテキストでの位置の特定 + /// - 何らかのクエリで得られた要素からコンテンツの[`location()`]($content.location)メソッドを用いて取得した[`location`] selector: LocatableSelector, ) -> HintedStrResult { selector.resolve_unique(engine.introspector, context) diff --git a/website/translation-status.json b/website/translation-status.json index b0d7b43f19..4992cc5ed2 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -146,7 +146,7 @@ "/docs/reference/introspection/": "untranslated", "/docs/reference/introspection/counter/": "untranslated", "/docs/reference/introspection/here/": "untranslated", - "/docs/reference/introspection/locate/": "untranslated", + "/docs/reference/introspection/locate/": "translated", "/docs/reference/introspection/location/": "untranslated", "/docs/reference/introspection/metadata/": "untranslated", "/docs/reference/introspection/query/": "untranslated", From f3bc7f38fb1264fef634ea204fbb11d7082da846 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Wed, 22 Oct 2025 10:54:41 +0900 Subject: [PATCH 2/5] Update crates/typst-library/src/introspection/locate.rs --- crates/typst-library/src/introspection/locate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index 28a9f3cf5d..3439f4c4e3 100644 --- a/crates/typst-library/src/introspection/locate.rs +++ b/crates/typst-library/src/introspection/locate.rs @@ -5,7 +5,7 @@ use crate::engine::Engine; use crate::foundations::{func, Context, LocatableSelector}; use crate::introspection::Location; -/// 文書中の要素の位置を特定。 +/// 文書中の要素のロケーションを特定。 /// /// 厳密に1つだけの要素にマッチしなければならないセレクターを受け取り、要素の[`location`]を返します。 /// このlocationを用いると、特に、物理的な[`page`]($location.page)番号やその要素の[`position`]($location.position)(ページ番号、x座標、y座標)を取得できます。 From ec4a93984b26bd89023d3d19f336418e1327dafd Mon Sep 17 00:00:00 2001 From: ultimatile Date: Wed, 22 Oct 2025 10:54:48 +0900 Subject: [PATCH 3/5] Update crates/typst-library/src/introspection/locate.rs --- crates/typst-library/src/introspection/locate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index 3439f4c4e3..ba50d3c216 100644 --- a/crates/typst-library/src/introspection/locate.rs +++ b/crates/typst-library/src/introspection/locate.rs @@ -11,7 +11,7 @@ use crate::introspection::Location; /// このlocationを用いると、特に、物理的な[`page`]($location.page)番号やその要素の[`position`]($location.position)(ページ番号、x座標、y座標)を取得できます。 /// /// # 例 -/// 特定の要素の位置を特定します。 +/// 特定の要素のロケーションを特定します。 /// ```example /// #context [ /// Introduction is at: \ From cab4843037eaf83039ebbb77bd3950242f854bd6 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Wed, 22 Oct 2025 11:02:51 +0900 Subject: [PATCH 4/5] Update crates/typst-library/src/introspection/locate.rs Co-authored-by: Shunsuke KIMURA --- crates/typst-library/src/introspection/locate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index ba50d3c216..f0435654d6 100644 --- a/crates/typst-library/src/introspection/locate.rs +++ b/crates/typst-library/src/introspection/locate.rs @@ -25,7 +25,7 @@ pub fn locate( engine: &mut Engine, context: Tracked, /// 厳密に1つだけの要素にマッチしなければならないセレクター。 - /// その要素の位置が決定されます。 + /// その要素のロケーションが決定されます。 /// /// 以下との組み合わせが特に便利です。 /// - [`here`]と組み合わせた現在のコンテキストでの位置の特定 From ed6698ae09ca1ce039c94378b440eff7387ac570 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Wed, 22 Oct 2025 11:02:59 +0900 Subject: [PATCH 5/5] Update crates/typst-library/src/introspection/locate.rs Co-authored-by: Shunsuke KIMURA --- crates/typst-library/src/introspection/locate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index f0435654d6..6138bd150f 100644 --- a/crates/typst-library/src/introspection/locate.rs +++ b/crates/typst-library/src/introspection/locate.rs @@ -28,7 +28,7 @@ pub fn locate( /// その要素のロケーションが決定されます。 /// /// 以下との組み合わせが特に便利です。 - /// - [`here`]と組み合わせた現在のコンテキストでの位置の特定 + /// - [`here`]と組み合わせた現在のコンテキストでのロケーションの特定 /// - 何らかのクエリで得られた要素からコンテンツの[`location()`]($content.location)メソッドを用いて取得した[`location`] selector: LocatableSelector, ) -> HintedStrResult {