Skip to content

Commit 4a739f0

Browse files
committed
docs: Translate all documentation and code comments to English
1 parent 0ec00ae commit 4a739f0

34 files changed

+243
-241
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# k8s-job-wrapper
22

3-
`Job` `CronJob` をテンプレート化して使いやすくする CRD を提供します
3+
Provides a CRD to make `Job` and `CronJob` easier to use through templating.
44

55
> [!WARNING]
66
> This repository does not actively accept external contributions.
@@ -16,7 +16,7 @@
1616
- [direnv](https://github.com/direnv/direnv)
1717
- [kind](https://github.com/kubernetes-sigs/kind)
1818
- go version v1.25.0+
19-
- docker version 28.3.2+.
19+
- docker version 28.3.2+
2020

2121
## License
2222

hack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# hack
22

3-
開発ツールやCI/CDの効率化のためのスクリプトを置くディレクトリ
3+
A directory for scripts to streamline development tools and CI/CD.

hack/chart/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# chart
22

3-
CRD の Helm チャートを `./make.sh ${CHART_VERSION} ${CONTROLLER_IMAGE_REPO} ${CONTROLLER_IMAGE_TAG}` で生成できます
3+
You can generate the Helm chart for the CRD by running the following command: `./make.sh ${CHART_VERSION} ${CONTROLLER_IMAGE_REPO} ${CONTROLLER_IMAGE_TAG}`.
44

5-
## 仕組み
5+
## How it works
66

7-
[kubebuilder の Helm Plugin](https://book.kubebuilder.io/plugins/available/helm-v1-alpha) を使って Helm チャートを生成し [make.sh](./make.sh) によってチャートのバージョンや controller のイメージなどを置換します
7+
This project uses the [Kubebuilder Helm Plugin](https://book.kubebuilder.io/plugins/available/helm-v1-alpha) to generate Helm charts.
8+
The [`./make.sh`](./make.sh) script then replaces values such as the chart version and the controller image.
89

9-
Chart.yaml については置換ではなく [テンプレート](./Chart.yaml.tmpl) から生成したもので上書きします
10-
## 成果物
10+
The `Chart.yaml` file is not modified directly. Instead, it is overwritten with a new file generated from its [template](./Chart.yaml.tmpl).
1111

12-
`./make.sh ${CHART_VERSION} ${CONTROLLER_IMAGE_REPO} ${CONTROLLER_IMAGE_TAG} ${DESTINATION}` と実行した場合は `${DESTINATION}/k8s-job-wrapper-${CHART_VERSION}.tgz` が生成されます
12+
## Artifacts
1313

14-
DESTINATION を省略した場合はカレントディレクトリに生成されます
14+
Running the script as `./make.sh ${CHART_VERSION} ${CONTROLLER_IMAGE_REPO} ${CONTROLLER_IMAGE_TAG} ${DESTINATION}` will generate the file `${DESTINATION}/k8s-job-wrapper-${CHART_VERSION}.tgz`.
15+
16+
If you omit the `DESTINATION` argument, the file will be generated in the current directory.

hack/chart/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
#
4-
# Generate Helm chart
4+
# Generate Helm chart.
55
#
66

77
set -e

hack/deploy-local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
#
4-
# Install CRDs and deploy controller into the kind cluster
4+
# Install CRDs and deploy controller into the kind cluster.
55
#
66

77
log() {

hack/docs/README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
# docs
22

3-
CRD のドキュメントを `./make.sh ${DEST_DIR} ${K8S_VERSION}` で生成できます
3+
You can generate the documentation for the CRD with the following command: `./make.sh ${DEST_DIR} ${K8S_VERSION}`
44

5-
## 仕組み
5+
## How it works
66

7-
[crd-ref-docs](https://github.com/elastic/crd-ref-docs) を使って [CRDのスキーマ](../../api/v1) から [markdown](docs.md) を生成し [pandoc](https://github.com/jgm/pandoc) を使って html に変換します.
7+
This process uses [crd-ref-docs](https://github.com/elastic/crd-ref-docs) to generate a [Markdown file](./docs.md) from the [CRD schema](../../api/v1).
8+
The Markdown is then converted to HTML using [pandoc](https://github.com/jgm/pandoc).
89

9-
スタイルは公開されている CSS をベースに [カスタマイズ](docs.css) しています
10+
The visual style is based on a publicly available CSS that has been [customized](./docs.css) for this project.
1011

11-
## ローカルで確認
12+
## Viewing locally
1213

13-
`$DEST_DIR` に全部入りの `index.html` が作られるので、それをブラウザで開きます.
14+
A self-contained `index.html` file will be created in the `$DEST_DIR` directory. To view the documentation, simply open this file in your web browser.
1415

15-
## マニフェストの例の更新
16+
## Updating manifest examples
1617

17-
[examples/results](examples/results)`config/samples` の内容からコントローラーが生成するリソースです.
18-
これは手動で書き換える必要があります.
18+
The resources located in [examples/results](./examples/results) are generated by the controller from the contents of `config/samples`. These example manifests must be updated manually.
1919

20-
``` shell
21-
# PWD=プロジェクトのルート
22-
./kind.sh
20+
To do this, run the following commands from the project's root directory:
21+
22+
```shell
23+
# PWD=project_root
24+
make deploy-local
2325
make sample
2426
```
2527

26-
こうしてから `kubectl get job 作られたJOBの名前 -o yaml` などとして取得したものを [examples/results](examples/results) にコミットします
28+
After the sample resources are created, retrieve the YAML for the generated resource using `kubectl`.
29+
Then, commit the resulting YAML file to the [examples/results](./examples/results) directory.
30+
31+
For example: `kubectl get job <GENERATED_JOB_NAME> -o yaml`
2732

28-
Examples の部分の記事は [examples/generate.sh](examples/generate.sh) で作っています
33+
The "Examples" section of the final documentation is generated by the [examples/generate.sh](./examples/generate.sh) script.

hack/docs/docs.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
table {
2-
border-collapse: collapse; /* 隣接するボーダーを重ねて一本線にする */
2+
border-collapse: collapse; /* Collapse adjacent borders into a single line */
33
width: 100%;
44
}
55

@@ -9,9 +9,9 @@ th, td {
99
}
1010

1111
tbody tr {
12-
border-bottom: 1px solid #eee8d5; /* solarized lightのベース背景色に近い色 */
12+
border-bottom: 1px solid #eee8d5; /* A color similar to the base background color of Solarized Light */
1313
}
1414

1515
tbody tr:last-child {
16-
border-bottom: none; /* 最後の行の下線は不要 */
16+
border-bottom: none; /* No underline for the last line */
1717
}

hack/docs/docs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
2-
// Examples 内部のコードブロックの中の特定の語句を強調する
2+
// Highlights specific terms within code blocks inside "Examples".
33
//
4-
// NOTE: Examples セクションの配下にしぼってないので別の場所のコードブロックにも適用される
4+
// NOTE: This is not scoped to the "Examples" section, so it also applies to code blocks elsewhere.
55
//
66
document.addEventListener('DOMContentLoaded', function() {
77
const emphasizeTargets = [

hack/docs/docs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!-- Generated by tool. DO NOT EDIT. -->
22
# API Reference
3-
複数の似ている [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) のマニフェストを, 共通部分と差分のペアの形式で効率的に生成するためのカスタムリソースです.
3+
This is a custom resource for efficiently generating multiple similar [Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) and [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) manifests in the form of a common part and a set of differences.
44

5-
- [CRD PodProfile](#podprofile) Pod の Spec を共通部分として定義できます.
6-
- [CRD Job](#job) [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) を生成できます. これは [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) のパラメータと [CRD PodProfile](#podprofile) に対するパッチを含みます.
7-
- [CRD CronJob](#cronjob) [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) を生成できます. これは [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) のパラメータと [CRD PodProfile](#podprofile) に対するパッチを含みます.
5+
- The [PodProfile CRD](#podprofile) allows you to define a Pod's spec as the common part.
6+
- The [Job CRD](#job) can generate a [Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/). It includes parameters for the Job and a patch for the [PodProfile CRD](#podprofile).
7+
- The [CronJob CRD](#cronjob) can generate a [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/). It includes parameters for the CronJob and a patch for the [PodProfile CRD](#podprofile).
88

99
## Examples
1010
### Example of CronJob
@@ -625,9 +625,9 @@ _Appears in:_
625625

626626
<script>
627627
//
628-
// Examples 内部のコードブロックの中の特定の語句を強調する
628+
// Highlights specific terms within code blocks inside "Examples"
629629
//
630-
// NOTE: Examples セクションの配下にしぼってないので別の場所のコードブロックにも適用される
630+
// NOTE: This is not scoped to the "Examples" section, so it also applies to code blocks elsewhere
631631
//
632632
document.addEventListener('DOMContentLoaded', function() {
633633
const emphasizeTargets = [

hack/docs/make.sh

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ log() {
77
echo >&2 "$(basename "$0"): $*"
88
}
99

10-
# 指定した kubernetes バージョンの標準のリソースのドキュメントへのリンクを作るために必要
11-
# $1: kubernetes バージョン
10+
# Needed to link to the standard resource documentation for a specific Kubernetes version.
11+
# $1: kubernetes version
1212
generate_config() {
1313
local -r version="$1"
1414
cat <<EOS
@@ -29,10 +29,10 @@ generate_examples() {
2929
"${d}/examples/generate.sh"
3030
}
3131

32-
# CRD からドキュメントを生成する
33-
# $1: crd-ref-docs の設定ファイル
34-
# $2: CRD の go ファイルのディレクトリ
35-
# $3: 出力先ファイル
32+
# Generate documentation from the CRD.
33+
# $1: config of crd-ref-docs
34+
# $2: directory of go files of CRD
35+
# $3: destination file
3636
generate_docs() {
3737
local -r __config="$1"
3838
local -r __source="$2"
@@ -45,44 +45,43 @@ generate_docs() {
4545
--output-path "$__output"
4646
}
4747

48-
# 純粋に CRD から生み出された markdown の1つめの見出しのすぐ下に概要とマニフェスト例をつっこむ
49-
# $1: markdown ファイル
48+
# Inject the overview and manifest examples right under the first heading of the markdown purely generated from the CRD.
49+
# $1: destination markdown file
5050
insert_summary_and_examples() {
5151
local -r __out_md="$1"
52-
# 生成された markdown であることをコメントする
52+
# add a comment to indicate that this is an auto-generated markdown file
5353
echo '<!-- Generated by tool. DO NOT EDIT. -->'
54-
# 1つめの見出し
54+
# first heading
5555
head -n 1 "$__out_md"
56-
# 概要(日本語)
56+
# overview
5757
cat <<EOS
58-
複数の似ている [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) のマニフェストを, 共通部分と差分のペアの形式で効率的に生成するためのカスタムリソースです.
58+
This is a custom resource for efficiently generating multiple similar [Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) and [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) manifests in the form of a common part and a set of differences.
5959
60-
- [CRD PodProfile](#podprofile) Pod の Spec を共通部分として定義できます.
61-
- [CRD Job](#job) [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) を生成できます. これは [Job](https://kubernetes.io/ja/docs/concepts/workloads/controllers/job/) のパラメータと [CRD PodProfile](#podprofile) に対するパッチを含みます.
62-
- [CRD CronJob](#cronjob) [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) を生成できます. これは [CronJob](https://kubernetes.io/ja/docs/concepts/workloads/controllers/cron-jobs/) のパラメータと [CRD PodProfile](#podprofile) に対するパッチを含みます.
60+
- The [PodProfile CRD](#podprofile) allows you to define a Pod's spec as the common part.
61+
- The [Job CRD](#job) can generate a [Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/). It includes parameters for the Job and a patch for the [PodProfile CRD](#podprofile).
62+
- The [CronJob CRD](#cronjob) can generate a [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/). It includes parameters for the CronJob and a patch for the [PodProfile CRD](#podprofile).
6363
EOS
64-
# 改行しないとexamplesの見出しが消える
64+
# without a line break, the "examples" heading disappears
6565
echo
66-
# マニフェストの例
6766
generate_examples
68-
# 残り
67+
# remaining
6968
tail -n +2 "$__out_md"
7069
}
7170

72-
# CSS ファイルを生成する
73-
# $1: 外部 CSS ファイルの URL
74-
# $2: ローカル CSS ファイル
71+
# Generate css file.
72+
# $1: URL of the external css file
73+
# $2: local css file
7574
generate_css() {
7675
local -r __url="$1"
7776
local -r __file="$2"
7877
curl -o- -s -L "$__url"
7978
cat "$__file"
8079
}
8180

82-
# markdown html に変換する
83-
# $1: markdown ファイル
84-
# $2: CSS ファイル
85-
# $3: ページのタイトル
81+
# Convert markdown into html.
82+
# $1: markdown file
83+
# $2: css file
84+
# $3: html title
8685
generate_html() {
8786
local -r __out_md="$1"
8887
local -r __css="$2"
@@ -120,11 +119,11 @@ fi
120119

121120
readonly title="CRD of pixiv.net"
122121
readonly source_path="${d}/../../api/v1"
123-
# ベースにする CSS
122+
# base css
124123
readonly css_url="http://thomasf.github.io/solarized-css/solarized-light.min.css"
125-
# 追加の CSS
124+
# addtional css
126125
readonly css_file="${d}/docs.css"
127-
# 追加の JS
126+
# additional js
128127
readonly js_file="${d}/docs.js"
129128

130129

0 commit comments

Comments
 (0)