diff --git a/crates/typst-library/src/introspection/locate.rs b/crates/typst-library/src/introspection/locate.rs index 50f217851..6138bd150 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 5650257b3..8c1e9ff4e 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -146,7 +146,7 @@ "/docs/reference/introspection/": "translated", "/docs/reference/introspection/counter/": "translated", "/docs/reference/introspection/here/": "untranslated", - "/docs/reference/introspection/locate/": "untranslated", + "/docs/reference/introspection/locate/": "translated", "/docs/reference/introspection/location/": "untranslated", "/docs/reference/introspection/metadata/": "translated", "/docs/reference/introspection/query/": "untranslated",