From 4a39457f005fa93702122a239acf05182ea1e7d1 Mon Sep 17 00:00:00 2001 From: Katsuya Hidaka Date: Sun, 6 Feb 2022 22:21:31 +0900 Subject: [PATCH 1/5] Translated the README of Basic Usage --- test/features/section_report_basic/README.md | 42 ++++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/features/section_report_basic/README.md b/test/features/section_report_basic/README.md index c708b7b6..94df044c 100644 --- a/test/features/section_report_basic/README.md +++ b/test/features/section_report_basic/README.md @@ -1,39 +1,39 @@ -# Basic +# Basic Usage -section-report 形式では、ヘッダー・フッター・繰り返し行の3つの種類のセクションを複数定義でき、それらを組み合わせた PDF を生成することができる。 +In the section-format, multiple sections of three types can be defined (header, footer, and repeatable section), and PDFs can be generated by combining them. - [Example code](test_feature.rb) - [Example template file](template.tlf) - [Example PDF](expect.pdf) -## セクション +## Section types -ヘッダー `headers` +Header `headers` -- 複数定義できる -- テンプレートで定義した順に描画される -- パラメータで非表示にすることもできる -- "毎ページ表示" が有効なら毎ページ、そうでなければ最初のページに描画される (厳密にはパラメータグループごとに最初のページに描画) +- Multiple definitions possible +- Draw in the order defined in the template +- Can be hidden by a parameter +- If "show every page" is enabled, it will be drawn on every page, otherwise it will be drawn on the first page of each parameter group -フッター `footers` +Footer `footers` -- 複数定義できる -- テンプレートで定義した順に描画される -- パラメータで非表示にすることもできる +- Muliple definitions possible +- Draw in the order defined in the template +- Can be hidden by a parameter -繰り返し行 `details` +Detail `details` -- 複数定義できる -- パラメータで追加した順で描画される -- 繰り返し行の `id` を指定して追加することで、複数の行を組み合わせて描画することができる +- Multiple definitions possible +- Draw in the order added by the parameter +- Multiple definitions can be combined and drawn -## 改ページ +## Page break -ページに入り切らないセクションは、次のページに描画される。 +Sections overflowing the page are drawn on the next page. -## PDF の生成 +## Generating a PDF -次のようなパラメータを `Thinreports.generate` に渡すことで PDF を生成する。 +Generate a PDF by passing the following parameters to `Thinreports.generate`. ```ruby params = { @@ -70,7 +70,7 @@ params = { Thinreports.generate(params, filename: '/path/to/output.pdf') ``` -PDF データを取得する場合は `filename` を省略する。 +When getting PDF data, omit the `filename` argument. ```ruby Thinreports.generate(params) #=> PDF data From f98afe730f49e74ece8316fa94c420c7691ec202 Mon Sep 17 00:00:00 2001 From: Katsuya Hidaka Date: Tue, 8 Feb 2022 00:43:23 +0900 Subject: [PATCH 2/5] Translated the README of Multiple Groups --- test/features/section_report_multiple_groups/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/features/section_report_multiple_groups/README.md b/test/features/section_report_multiple_groups/README.md index 92a01bc3..fd1822ca 100644 --- a/test/features/section_report_multiple_groups/README.md +++ b/test/features/section_report_multiple_groups/README.md @@ -1,11 +1,12 @@ # Multiple Groups -group によって複数のパラメータを渡すことができ、それらを一つの PDF に描画することができる。 +Multiple parameter sets can be passed as a group and drawn into a single PDF. - [Example code](test_feature.rb) - [Example template file](template.tlf) - [Example PDF](expect.pdf) -group の主な機能は次の通り。 -- group ごとに改ページされる -- "毎ページ表示" オプションが無効なヘッダーやフッターは group ごとに描画される +The main functions of groups are as follows: + +- Page break for each group +- Headers and footers for which the "show every page" is disabled will be drawn only once per group From fa2410c5ddd8cb74a78925bd6b8d58b465106b82 Mon Sep 17 00:00:00 2001 From: Katsuya Hidaka Date: Wed, 9 Feb 2022 01:45:49 +0900 Subject: [PATCH 3/5] Translated the README of Section Auto Stretch --- .../README.md | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/test/features/section_report_section_auto_stretch/README.md b/test/features/section_report_section_auto_stretch/README.md index b29e62f4..39c7f698 100644 --- a/test/features/section_report_section_auto_stretch/README.md +++ b/test/features/section_report_section_auto_stretch/README.md @@ -1,55 +1,57 @@ # Section Auto Stretch -自動伸縮を有効にすることで、描画後の内容に応じて section の高さを自動的に伸縮させることができる。 +By enabling auto-stretch, the height of the section can be automatically stretched according to the content after drawing. - [Example code](test_feature.rb) - [Example template file](template.tlf) - [Example PDF](expect.pdf) -## 伸縮時の高さの算出 +## Calculating the height when stretching -### 下余白とコンテンツの下位置 +### Bottom margin and bottom position of content -section の伸縮後の高さは「下余白」と「コンテンツの下位置」によって決定する。 +The height of the section after it is stretched is determined by the bottom margin and the bottom position of the content. -コンテンツの下位置 -- section 内の item の最下部の位置を指す (「下余白に影響」が無効の item は除外) -- 描画結果によって変動する +Bottom Position of Content -下余白 -- コンテンツの下位置から section の下位置との距離又は領域を指す -- 定義時の内容で決定し不変 +- The bottom position of the item in the section (except for items for which "Affect bottom margin" is disabled) +- Varies depending on the drawing result -詳細は [Section Bottom Margin](../section_report_section_bottom_margin/README.md) を参照。 +Bottom Margin -### 高さの算出 +- The height or area between the bottom position of the content and the bottom position of the section +- Determined and fixed by the content of the template definition -section の高さは次のように定義する。 +See [Section Bottom Margin](../section_report_section_bottom_margin/README.md) for details. + +### Calculating the height + +The height of the section is defined as follows: ``` -section の高さ = コンテンツの下位置 + 下余白の高さ +height of section = bottom of content + height of bottom margin ``` -text-block や stack-view などの item が伸縮した場合、コンテンツの下位置が変動する可能性がある。sectionの自動伸縮が有効な場合、その変動後のコンテンツの下位置に基づいてsectionの高さが変化する。 +When an item such as text-block or stack-view is stretched, the bottom position of the content may change, and if auto-stretch of the section is enabled, the height of the section will be changed based on the changed bottom position of the content. -## 拡張 +## Expanding the height -高さの拡張は以下の条件によって発生する。 +Expanding the height occurs in the following cases: -- text-block の描画後の高さが定義の高さよりも高くなり、その結果 section のコンテンツの下位置が大きくなる場合 -- stack-view の描画後の高さが定義の高さよりも高くなり、その結果 section のコンテンツの下位置が大きくなる場合 +- When the height of the text-block after drawing becomes higher than the defined height, and as a result, the bottom position of the section content becomes larger +- When the height of stack-view becomes higher than the defined height, and as a result, the bottom position of the section content becomes larger -このとき、section は以下のように拡張する。 +In these cases, the height of the section is expanded as follows: ![](images/auto-stretch-expand.png) -## 縮小 +## Shrinking the height -高さの縮小は以下の条件によって発生する。 +Shrinking the height occurs in the following cases: -- stack-view の高さが定義の高さよりも小さくなり、その結果 section のコンテンツの下位置が小さくなる場合 -- 縦位置が「上揃え」の image-block の画像が定義した領域の高さよりも小さくなり、その結果 section のコンテンツの下位置が小さくなる場合 +- When the height of the stack-view becomes smaller than the defined height, and as a result, the bottom position of the section content becomes smaller +- When the image of an image-block whose vertical position is top becomes smaller than the height of the defined area, and as a result, the bottom position of the section content becomes smaller -このとき、section は以下のように縮小する。 +In these cases, the height of the section is shrinked as follows: ![](images/auto-stretch-shrink.png) From aa5178d43660ca99b8ca4ac8124180043076916d Mon Sep 17 00:00:00 2001 From: Katsuya Hidaka Date: Thu, 10 Feb 2022 00:30:02 +0900 Subject: [PATCH 4/5] Translated the README of Section Bottom Margin --- .../section_report_section_bottom_margin/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/features/section_report_section_bottom_margin/README.md b/test/features/section_report_section_bottom_margin/README.md index dc6f90a8..f83d9a25 100644 --- a/test/features/section_report_section_bottom_margin/README.md +++ b/test/features/section_report_section_bottom_margin/README.md @@ -1,17 +1,17 @@ # Section Bottom Margin -section の下余白(bottom margin)とは、section のコンテンツの下位置と、section の下位置との間の距離である。 +The bottom margin of a section is the distance between the bottom position of the section content and the bottom position of the section. - [Example code](test_feature.rb) - [Example template file](template.tlf) - [Example PDF](expect.pdf) - -「下余白に影響(affect-bottom-margin)」が無効の item は、下余白には影響しない。 +An item whose affect-bottom-margin is disabled does not affect the calculation of the bottom margin. ![](images/bottom-margin-diagram-1.png) -上図の例の場合、item3 は「下余白に影響」が無効なので、下余白には影響しない。 -item2 の下位置が「sectionのコンテンツの下位置」となるため、item2の下位置と section の下位置の間(グレーの網掛けの部分)が、この section の下余白となる。 +In the example above, item3 does not affect the bottom margin because affect-bottom-margin is disabled. + +Since the bottom position of item2 is the bottom position of the section content, the space between the bottoom position of item2 and the bottom position of the section (the gray shaded area) is the bottom margin of this section. -section の自動伸縮が有効のときは、section の下余白を保った状態で section が自動的に伸縮する。詳細は [Section Auto Stretch](../section_report_section_auto_stretch/README.md) を参照 +When auto-stretch is enabled, the section will be automatically stretched while keepking the bottom margin of the section. See [Section Auto Stretch](../section_report_section_auto_stretch/README.md) for details. From bc0a957ff2ee68a081588f27c407a58b93c29503 Mon Sep 17 00:00:00 2001 From: Katsuya Hidaka Date: Tue, 15 Feb 2022 01:20:41 +0900 Subject: [PATCH 5/5] Translated the README of Section Parameter --- .../section_report_section_parameters/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/features/section_report_section_parameters/README.md b/test/features/section_report_section_parameters/README.md index d8e494e4..9c79002c 100644 --- a/test/features/section_report_section_parameters/README.md +++ b/test/features/section_report_section_parameters/README.md @@ -1,14 +1,14 @@ # Section Parameter -各 section の定義時のプロパティの一部はパラメータで変更することができる。 +Some properties in the definition of each section can be changed by parameters. - [Example code](test_feature.rb) - [Example template file](template.tlf) - [Example PDF](expect.pdf) -## 表示 +## Display -header と footer は `display` プロパティで表示または非表示にすることができる。 +Headers and footers can be shown or hidden with the display property. ``` header_and_footer: { @@ -16,9 +16,9 @@ header_and_footer: { } ``` -## 最小の高さ +## Minimum height -`min_height` プロパティで section の描画時の最小の高さを指定することができる。 +The min_height property can be used to set the minimum height of a section. ``` header_and_footer: {