Skip to content

Commit 9fe2db5

Browse files
ultimatileCopilotkimushun1101
authored
/docs/reference/introspection/locationの翻訳 (#320)
Signed-off-by: Shunsuke Kimura <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Shunsuke Kimura <[email protected]>
1 parent 15c0224 commit 9fe2db5

File tree

3 files changed

+23
-30
lines changed

3 files changed

+23
-30
lines changed

crates/typst-library/src/introspection/location.rs

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ use crate::foundations::{func, scope, ty, Repr};
88
use crate::layout::Position;
99
use crate::model::Numbering;
1010

11-
/// Identifies an element in the document.
11+
/// 文書中の要素の識別。
1212
///
13-
/// A location uniquely identifies an element in the document and lets you
14-
/// access its absolute position on the pages. You can retrieve the current
15-
/// location with the [`here`] function and the location of a queried or shown
16-
/// element with the [`location()`]($content.location) method on content.
13+
/// locationは文書中の要素を一意に識別し、ページ中での絶対位置へのアクセスを提供します。
14+
/// [`here`]関数を用いて現在のロケーションを取得可能です。
15+
/// また、検索したロケーションや表示された要素のロケーションは、コンテンツの[`location()`]($content.location)メソッドを使って取得できます。
1716
///
18-
/// # Locatable elements { #locatable }
19-
/// Currently, only a subset of element functions is locatable. Aside from
20-
/// headings and figures, this includes equations, references, quotes and all
21-
/// elements with an explicit label. As a result, you _can_ query for e.g.
22-
/// [`strong`] elements, but you will find only those that have an explicit
23-
/// label attached to them. This limitation will be resolved in the future.
17+
/// # ロケータブル要素 { #locatable }
18+
/// 現在、要素関数の一部のみがロケーションを取得可能です。
19+
/// 見出しや図表の他に、数式、参照、引用、全ての明示的なラベルを持つ要素が該当します。
20+
/// したがって、例えば[`strong`]要素に対してクエリが実行 _可能_ ですが、見つかるのは明示的にラベルが付けられたもののみです。
21+
/// この制限は将来的に解消される予定です。
2422
#[ty(scope)]
2523
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
2624
pub struct Location(u128);
@@ -48,16 +46,13 @@ impl Location {
4846

4947
#[scope]
5048
impl Location {
51-
/// Returns the page number for this location.
49+
/// このlocationのページ番号を返します。
5250
///
53-
/// Note that this does not return the value of the [page counter]($counter)
54-
/// at this location, but the true page number (starting from one).
51+
/// このlocationの[ページカウンター]($counter)の値を返すのではなく、(1始まりの)実際のページ番号を返すことに注意してください。
5552
///
56-
/// If you want to know the value of the page counter, use
57-
/// `{counter(page).at(loc)}` instead.
53+
/// ページカウンターの値が知りたい場合は代わりに`{counter(page).at(loc)}`を使用してください。
5854
///
59-
/// Can be used with [`here`] to retrieve the physical page position
60-
/// of the current context:
55+
/// [`here`]と組み合わせることで現在のコンテキストにおける実際のページ番号が取得できます。
6156
/// ```example
6257
/// #context [
6358
/// I am located on
@@ -69,24 +64,20 @@ impl Location {
6964
engine.introspector.page(self)
7065
}
7166

72-
/// Returns a dictionary with the page number and the x, y position for this
73-
/// location. The page number starts at one and the coordinates are measured
74-
/// from the top-left of the page.
67+
/// このlocationのページ番号とx座標とy座標を辞書で返します。
68+
/// ページ番号は1始まりで、座標はページの左上から測ります。
7569
///
76-
/// If you only need the page number, use `page()` instead as it allows
77-
/// Typst to skip unnecessary work.
70+
/// ページ番号のみに興味がある場合は、代わりに`page()`を使用すると不要な処理を省略できます。
7871
#[func]
7972
pub fn position(self, engine: &mut Engine) -> Position {
8073
engine.introspector.position(self)
8174
}
8275

83-
/// Returns the page numbering pattern of the page at this location. This
84-
/// can be used when displaying the page counter in order to obtain the
85-
/// local numbering. This is useful if you are building custom indices or
86-
/// outlines.
76+
/// このlocationのページ番号の番号付けパターンを返します。
77+
/// これにより、ページカウンターの表示する際に、その位置での番号付けを取得できます。
78+
/// これは独自の索引やアウトラインを作成する場合に便利です。
8779
///
88-
/// If the page numbering is set to `{none}` at that location, this function
89-
/// returns `{none}`.
80+
/// そのロケーションのページの番号付けが`{none}`に設定されていた場合、`{none}`を返します。
9081
#[func]
9182
pub fn page_numbering(self, engine: &mut Engine) -> Option<Numbering> {
9283
engine.introspector.page_numbering(self).cloned()

docs/glossary.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ description: |
2525
| table || データや情報を整理して表示する要素 |
2626
| supplement | 補足語 | [参照]($ref)されるものの種類を指す文字列、「図1」の「図」など |
2727
| numbering | 番号付け | [見出し]($heading/#parameters-numbering)[図表]($figure/#parameters-numbering)[番号付きリスト]($enum/#parameters-numbering)などの番号の書式を定義する方法 |
28+
| location | ロケーション | [ロケーション]($location)を参照 |
29+
| locatable | ロケータブル | [ロケータブル要素]($location/#locatable)を参照 |

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"/docs/reference/introspection/counter/": "translated",
148148
"/docs/reference/introspection/here/": "translated",
149149
"/docs/reference/introspection/locate/": "translated",
150-
"/docs/reference/introspection/location/": "untranslated",
150+
"/docs/reference/introspection/location/": "translated",
151151
"/docs/reference/introspection/metadata/": "translated",
152152
"/docs/reference/introspection/query/": "untranslated",
153153
"/docs/reference/introspection/state/": "untranslated",

0 commit comments

Comments
 (0)