Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions crates/typst-library/src/introspection/here.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,27 @@ use crate::diag::HintedStrResult;
use crate::foundations::{func, Context};
use crate::introspection::Location;

/// Provides the current location in the document.
/// 文書中における現在位置を提供。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここもロケーションでしょうか?

Suggested change
/// 文書中における現在位置を提供
/// 文書中における現在のロケーションを提供

///
/// You can think of `here` as a low-level building block that directly extracts
/// the current location from the active [context]. Some other functions use it
/// internally: For instance, `{counter.get()}` is equivalent to
/// `{counter.at(here())}`.
/// `here`はアクティブな[コンテキスト]($context)から現在位置を直接取得する低レベルな構成要素と考えることができます。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hereはlocation型を返すのでこれはロケーションのことです。

Suggested change
/// `here`はアクティブな[コンテキスト]($context)から現在位置を直接取得する低レベルな構成要素と考えることができます
/// `here`はアクティブな[コンテキスト]($context)から現在のロケーションを直接取得する低レベルな構成要素と考えることができます

/// いくつかの他の関数が内部で使用しています。
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] 文の主語述語が不自然です。受け身にすると自然な日本語になります。提案: 『いくつかの他の関数でも内部で使用されています。』

Suggested change
/// いくつかの他の関数が内部で使用しています
/// いくつかの他の関数でも内部で使用されています

Copilot uses AI. Check for mistakes.

/// 例えば、`{counter.get()}`は`{counter.at(here())}`と等価です。
///
/// Within show rules on [locatable]($location/#locatable) elements, `{here()}`
/// will match the location of the shown element.
/// [ロケータブル]($location/#locatable)要素に対するshowルールにおいて、`{here()}`は表示する要素の位置にマッチします。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// [ロケータブル]($location/#locatable)要素に対するshowルールにおいて、`{here()}`は表示する要素の位置にマッチします
/// [ロケータブル]($location/#locatable)要素に対するshowルールにおいて、`{here()}`は表示する要素のロケーションにマッチします

///
/// If you want to display the current page number, refer to the documentation
/// of the [`counter`] type. While `here` can be used to determine the physical
/// page number, typically you want the logical page number that may, for
/// instance, have been reset after a preface.
/// 現在のページ番号を表示したい場合は、[`counter`]型のドキュメントを参照してください。
/// `here`は物理的なページ番号を決定できますが、通常は、前書きの後にリセットされるような、論理的なページ番号が必要でしょう。
///
/// # Examples
/// Determining the current position in the document in combination with the
/// [`position`]($location.position) method:
/// # 例
/// [`position`]($location.position)メソッドと組み合わせて文書中での現在位置を決定します。
/// ```example
/// #context [
/// I am located at
/// #here().position()
/// ]
/// ```
///
/// Running a [query] for elements before the current position:
/// 現在位置より前にある要素に対して[クエリ]($query)を実行します。
/// ```example
/// = Introduction
/// = Background
Expand All @@ -42,7 +37,7 @@ use crate::introspection::Location;
///
/// = Conclusion
/// ```
/// Refer to the [`selector`] type for more details on before/after selectors.
/// セレクターのbeforeおよびafterに関する詳細は[`selector`]型のドキュメントを参照してください。
#[func(contextual)]
pub fn here(context: Tracked<Context>) -> HintedStrResult<Location> {
context.location()
Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"/docs/reference/visualize/tiling/": "untranslated",
"/docs/reference/introspection/": "untranslated",
"/docs/reference/introspection/counter/": "untranslated",
"/docs/reference/introspection/here/": "untranslated",
"/docs/reference/introspection/here/": "translated",
"/docs/reference/introspection/locate/": "untranslated",
"/docs/reference/introspection/location/": "untranslated",
"/docs/reference/introspection/metadata/": "untranslated",
Expand Down