Skip to content

Commit d6fa3a6

Browse files
committed
/docs/reference/layout/gridの翻訳
1 parent c8ba304 commit d6fa3a6

File tree

2 files changed

+62
-104
lines changed

2 files changed

+62
-104
lines changed

crates/typst-library/src/layout/grid/mod.rs

Lines changed: 61 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,38 @@ use crate::layout::{
1919
use crate::model::{TableCell, TableFooter, TableHLine, TableHeader, TableVLine};
2020
use crate::visualize::{Paint, Stroke};
2121

22-
/// Arranges content in a grid.
22+
/// グリッド状にコンテンツを配置。
2323
///
24-
/// The grid element allows you to arrange content in a grid. You can define the
25-
/// number of rows and columns, as well as the size of the gutters between them.
26-
/// There are multiple sizing modes for columns and rows that can be used to
27-
/// create complex layouts.
24+
/// グリッド要素を用いるとコンテンツをグリッド状に配置することができます。
25+
/// 行と列の数に加えて、それらの間隔を定義することができます。
26+
/// 複雑なレイアウトが作成できるような、列と行の大きさに関するモードが複数あります。
2827
///
29-
/// While the grid and table elements work very similarly, they are intended for
30-
/// different use cases and carry different semantics. The grid element is
31-
/// intended for presentational and layout purposes, while the
32-
/// [`{table}`]($table) element is intended for, in broad terms, presenting
33-
/// multiple related data points. In the future, Typst will annotate its output
34-
/// such that screenreaders will announce content in `table` as tabular while a
35-
/// grid's content will be announced no different than multiple content blocks
36-
/// in the document flow. Set and show rules on one of these elements do not
37-
/// affect the other.
28+
/// グリッド要素とテーブル要素はとてもよく似た挙動をする一方で、これらは異なるユースケースが想定されており、異なる意味論が提供されています。
29+
/// グリッド要素はプレゼンテーションおよびレイアウトに使われることが想定されている一方で、[`{table}`]($table)要素は複数の関係データ点を表す広い用途が想定されています。
30+
/// 将来的にTypst will annotate 出力 such that スクリーンリーダー will announce コンテンツ in `table` as tabular while a グリッドのコンテンツ will be announced no different than multiple コンテンツブロック in the 文書の流れ
31+
/// これらの要素に対するsetルールとshowルールは、互いに影響しません。
3832
///
39-
/// A grid's sizing is determined by the track sizes specified in the arguments.
40-
/// Because each of the sizing parameters accepts the same values, we will
41-
/// explain them just once, here. Each sizing argument accepts an array of
42-
/// individual track sizes. A track size is either:
33+
/// グリッドの大きさは引数に指定されたトラックサイズによって決定されます。
34+
/// 大きさを設定する各パラメーターは同じ値を受け入れるため、ここでまとめて説明します。
35+
/// 各sizing引数は個々のトラックサイズの配列を受け入れます。
36+
/// トラックサイズは以下のいずれかです。
4337
///
44-
/// - `{auto}`: The track will be sized to fit its contents. It will be at most
45-
/// as large as the remaining space. If there is more than one `{auto}` track
46-
/// width, and together they claim more than the available space, the `{auto}`
47-
/// tracks will fairly distribute the available space among themselves.
38+
/// - `{auto}`: トラックはコンテンツに合わせた大きさになります。
39+
/// It will be at most as large as the remaining space.
40+
/// If there is more than one `{auto}` track width, and together they claim more than the available space, the `{auto}` tracks will fairly distribute the available space among themselves.
4841
///
49-
/// - A fixed or relative length (e.g. `{10pt}` or `{20% - 1cm}`): The track
50-
/// will be exactly of this size.
42+
/// - A fixed or relative length (e.g. `{10pt}` or `{20% - 1cm}`): The track will be exactly of this size.
5143
///
52-
/// - A fractional length (e.g. `{1fr}`): Once all other tracks have been sized,
53-
/// the remaining space will be divided among the fractional tracks according
54-
/// to their fractions. For example, if there are two fractional tracks, each
55-
/// with a fraction of `{1fr}`, they will each take up half of the remaining
56-
/// space.
44+
/// - A fractional length (e.g. `{1fr}`): Once all other tracks have been sized, the remaining space will be divided among the fractional tracks according to their fractions.
45+
/// For example, if there are two fractional tracks, each with a fraction of `{1fr}`, they will each take up half of the remaining space.
5746
///
58-
/// To specify a single track, the array can be omitted in favor of a single
59-
/// value. To specify multiple `{auto}` tracks, enter the number of tracks
60-
/// instead of an array. For example, `columns:` `{3}` is equivalent to
61-
/// `columns:` `{(auto, auto, auto)}`.
47+
/// 単一のトラックを指定する場合は、配列を省略して単一の値を指定できます。
48+
/// 複数の`{auto}`のトラックを指定する場合は、配列の代わりにトラックの数を入力して下さい。
49+
/// 例えば、`columns:` `{3}`は`columns:` `{(auto, auto, auto)}`と同じ意味になります。
6250
///
63-
/// # Examples
64-
/// The example below demonstrates the different track sizing options. It also
65-
/// shows how you can use [`grid.cell`]($grid.cell) to make an individual cell
66-
/// span two grid tracks.
51+
/// # 例
52+
/// The example below demonstrates the different track sizing options.以下の例は異なるトラックサイズオプションの実演です。
53+
/// また、1つのセルをグリッドの2つのトラックに跨がせるために[`grid.cell`]($grid.cell)をどう使うのかも示しています。
6754
///
6855
/// ```example
6956
/// // We use `rect` to emphasize the
@@ -89,8 +76,7 @@ use crate::visualize::{Paint, Stroke};
8976
/// )
9077
/// ```
9178
///
92-
/// You can also [spread]($arguments/#spreading) an array of strings or content
93-
/// into a grid to populate its cells.
79+
/// You can also [spread]($arguments/#spreading) an array of strings or content into a grid to populate its cells.
9480
///
9581
/// ```example
9682
/// #grid(
@@ -100,88 +86,70 @@ use crate::visualize::{Paint, Stroke};
10086
/// )
10187
/// ```
10288
///
103-
/// # Styling the grid
104-
/// The grid's appearance can be customized through different parameters. These
105-
/// are the most important ones:
89+
/// # グリッドのスタイル設定
90+
/// グリッドの外観は様々なパラメーターでカスタマイズできます。
91+
/// 以下のものが最も重要です。
10692
///
107-
/// - [`fill`]($grid.fill) to give all cells a background
108-
/// - [`align`]($grid.align) to change how cells are aligned
93+
/// - [`fill`]($grid.fill)は全てのセルに背景を設定します。
94+
/// - [`align`]($grid.align)はセルの配置方法を変更します。
10995
/// - [`inset`]($grid.inset) to optionally add internal padding to each cell
110-
/// - [`stroke`]($grid.stroke) to optionally enable grid lines with a certain
111-
/// stroke
96+
/// - [`stroke`]($grid.stroke)は特定のストロークでグリッドの線をオプションで有効化します。
11297
///
113-
/// If you need to override one of the above options for a single cell, you can
114-
/// use the [`grid.cell`]($grid.cell) element. Likewise, you can override
115-
/// individual grid lines with the [`grid.hline`]($grid.hline) and
116-
/// [`grid.vline`]($grid.vline) elements.
98+
/// もし単一セルに対して上記のオプションの1つを上書きしなければならない場合は、[`grid.cell`]($grid.cell)要素が使用できます。
99+
/// 同様に、個々のグリッドの線も[`grid.hline`]($grid.hline)要素や[`grid.vline`]($grid.vline)要素を用いて上書きできます。
117100
///
118-
/// Alternatively, if you need the appearance options to depend on a cell's
119-
/// position (column and row), you may specify a function to `fill` or `align`
120-
/// of the form `(column, row) => value`. You may also use a show rule on
121-
/// [`grid.cell`]($grid.cell) - see that element's examples or the examples
122-
/// below for more information.
101+
/// Alternatively, if you need the appearance options to depend on a cell's position (column and row), you may specify a function to `fill` or `align` of the form `(column, row) => value`.
102+
/// You may also use a showルール on [`grid.cell`]($grid.cell) - see that element's examples or the examples below for more information.
123103
///
124-
/// Locating most of your styling in set and show rules is recommended, as it
125-
/// keeps the grid's or table's actual usages clean and easy to read. It also
126-
/// allows you to easily change the grid's appearance in one place.
104+
/// Locating most of your styling in set and show rules is recommended, as it keeps the grid's or table's actual usages clean and easy to read.
105+
/// It also allows you to easily change the grid's appearance in one place.
127106
///
128107
/// ## Stroke styling precedence
129-
/// There are three ways to set the stroke of a grid cell: through
130-
/// [`{grid.cell}`'s `stroke` field]($grid.cell.stroke), by using
131-
/// [`{grid.hline}`]($grid.hline) and [`{grid.vline}`]($grid.vline), or by
132-
/// setting the [`{grid}`'s `stroke` field]($grid.stroke). When multiple of
133-
/// these settings are present and conflict, the `hline` and `vline` settings
134-
/// take the highest precedence, followed by the `cell` settings, and finally
135-
/// the `grid` settings.
108+
/// There are three ways to set the stroke of a grid cell: through [`{grid.cell}`'s `stroke` field]($grid.cell.stroke), by using [`{grid.hline}`]($grid.hline) and [`{grid.vline}`]($grid.vline), or by setting the [`{grid}`'s `stroke` field]($grid.stroke).
109+
/// When multiple of these settings are present and conflict, the `hline` and `vline` settings take the highest precedence, followed by the `cell` settings, and finally the `grid` settings.
136110
///
137-
/// Furthermore, strokes of a repeated grid header or footer will take
138-
/// precedence over regular cell strokes.
111+
/// Furthermore, strokes of a repeated grid header or footer will take precedence over regular cell strokes.
139112
#[elem(scope, Show)]
140113
pub struct GridElem {
141114
/// The column sizes.
142115
///
143-
/// Either specify a track size array or provide an integer to create a grid
144-
/// with that many `{auto}`-sized columns. Note that opposed to rows and
145-
/// gutters, providing a single track size will only ever create a single
146-
/// column.
116+
/// Either specify a track size array or provide an integer to create a grid with that many `{auto}`-sized columns.
117+
/// Note that opposed to rows and gutters, providing a single track size will only ever create a single column.
147118
#[borrowed]
148119
pub columns: TrackSizings,
149120

150121
/// The row sizes.
151122
///
152-
/// If there are more cells than fit the defined rows, the last row is
153-
/// repeated until there are no more cells.
123+
/// If there are more cells than fit the defined rows, the last row is repeated until there are no more cells.
154124
#[borrowed]
155125
pub rows: TrackSizings,
156126

157-
/// The gaps between rows and columns.
127+
/// 行間と列間の間隔。
158128
///
159-
/// If there are more gutters than defined sizes, the last gutter is
160-
/// repeated.
129+
/// If there are more gutters than defined sizes, the last gutter is repeated.
161130
///
162-
/// This is a shorthand to set `column-gutter` and `row-gutter` to the same
163-
/// value.
131+
/// これは`column-gutter`と`row-gutter`を同じ値で設定する省略記法です。
164132
#[external]
165133
pub gutter: TrackSizings,
166134

167-
/// The gaps between columns.
135+
/// 列間の間隔。
168136
#[parse(
169137
let gutter = args.named("gutter")?;
170138
args.named("column-gutter")?.or_else(|| gutter.clone())
171139
)]
172140
#[borrowed]
173141
pub column_gutter: TrackSizings,
174142

175-
/// The gaps between rows.
143+
/// 行間の間隔。
176144
#[parse(args.named("row-gutter")?.or_else(|| gutter.clone()))]
177145
#[borrowed]
178146
pub row_gutter: TrackSizings,
179147

180-
/// How to fill the cells.
148+
/// セルの塗り潰し方。
181149
///
182-
/// This can be a color or a function that returns a color. The function
183-
/// receives the cells' column and row indices, starting from zero. This can
184-
/// be used to implement striped grids.
150+
/// これはcolorかcolorを返す関数が使用可能です。
151+
/// 関数は0始まりの列番号と行番号を受け取ります。
152+
/// これは縞模様のグリッドの実装に使えます。
185153
///
186154
/// ```example
187155
/// #grid(
@@ -200,28 +168,21 @@ pub struct GridElem {
200168
#[borrowed]
201169
pub fill: Celled<Option<Paint>>,
202170

203-
/// How to align the cells' content.
171+
/// セルのコンテンツをどう配置するか。
204172
///
205-
/// This can either be a single alignment, an array of alignments
206-
/// (corresponding to each column) or a function that returns an alignment.
207-
/// The function receives the cells' column and row indices, starting from
208-
/// zero. If set to `{auto}`, the outer alignment is used.
173+
/// 単一の配置、(各列に対応する)配置の配列、配置を返す関数のいずれかが使用可能です。
174+
/// The function receives the cells' column and row indices, starting from zero.
175+
/// `{auto}`に設定された場合外側の配置が使用されます。
209176
///
210-
/// You can find an example for this argument at the
211-
/// [`table.align`]($table.align) parameter.
177+
/// You can find an example for this argument at the [`table.align`]($table.align) parameter.
212178
#[borrowed]
213179
pub align: Celled<Smart<Alignment>>,
214180

215181
/// How to [stroke]($stroke) the cells.
216182
///
217-
/// Grids have no strokes by default, which can be changed by setting this
218-
/// option to the desired stroke.
183+
/// デフォルトではグリッドにストロークはありませんが、このオプションを所望のストロークに設定すれば変更できます。
219184
///
220-
/// If it is necessary to place lines which can cross spacing between cells
221-
/// produced by the `gutter` option, or to override the stroke between
222-
/// multiple specific cells, consider specifying one or more of
223-
/// [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline) alongside
224-
/// your grid cells.
185+
/// If it is necessary to place lines which can cross spacing between cells produced by the `gutter` option, or to override the stroke between multiple specific cells, consider specifying one or more of [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline) alongside your grid cells.
225186
///
226187
/// ```example
227188
/// #set page(height: 13em, width: 26em)
@@ -295,14 +256,11 @@ pub struct GridElem {
295256

296257
/// How much to pad the cells' content.
297258
///
298-
/// You can find an example for this argument at the
299-
/// [`table.inset`]($table.inset) parameter.
259+
/// You can find an example for this argument at the [`table.inset`]($table.inset) parameter.
300260
#[fold]
301261
pub inset: Celled<Sides<Option<Rel<Length>>>>,
302262

303-
/// The contents of the grid cells, plus any extra grid lines specified
304-
/// with the [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline)
305-
/// elements.
263+
/// The contents of the grid cells, plus any extra grid lines specified with the [`grid.hline`]($grid.hline) and [`grid.vline`]($grid.vline) elements.
306264
///
307265
/// The cells are populated in row-major order.
308266
#[variadic]

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"/docs/reference/layout/columns/": "untranslated",
111111
"/docs/reference/layout/direction/": "translated",
112112
"/docs/reference/layout/fraction/": "translated",
113-
"/docs/reference/layout/grid/": "untranslated",
113+
"/docs/reference/layout/grid/": "translated",
114114
"/docs/reference/layout/hide/": "translated",
115115
"/docs/reference/layout/layout/": "translated",
116116
"/docs/reference/layout/length/": "translated",

0 commit comments

Comments
 (0)