-
Notifications
You must be signed in to change notification settings - Fork 10
turbo reference event: updated translation #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
turbo reference event: updated translation #198
Conversation
b3371dc to
cd9e32b
Compare
It will be fixed at hotwired/turbo-site#230
7a23128 to
a5ac0a0
Compare
turbo/reference/events.md
Outdated
|
|
||
| ### `turbo:visit` | ||
|
|
||
| ページ遷移が開始された直後に発火します。`event.detail.url` でリクエストされたロケーションと `event.detail.action` でページ遷移のアクションを取得できます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
を、で繋いだほうがわかりやすいかもと思いました
| ページ遷移が開始された直後に発火します。`event.detail.url` でリクエストされたロケーションと `event.detail.action` でページ遷移のアクションを取得できます。 | |
| ページ遷移が開始された直後に発火します。`event.detail.url` でリクエストされたロケーションを、 `event.detail.action` でページ遷移のアクションを取得できます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 4241a4b
turbo/reference/events.md
Outdated
|
|
||
| ### `turbo:before-visit` | ||
|
|
||
| あるロケーションに移動する前に発火します(ただし、履歴操作によるナビゲーション時は除きます)。`event.detail.url` からリクエスト先のロケーションを取得できます。このイベントをキャンセルすると、ナビゲーションが行われなくなります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原文と言葉のニュアンスが若干変わりそうですが、
turbo:visitと合わせて、「ページ遷移が開始される直前に発火します」とかもありです?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: d24d444
turbo/reference/events.md
Outdated
| | `renderMethod` | `"replace" \| "morph"` | 新しいコンテンツを描画するときに使われる方式 | ||
| | `newBody` | [HTMLBodyElement][] | 現在の `<body>` 要素を置き換える新しい `<body>` 要素 | ||
| | `resume` | `(value?: any) => void` | [描画の一時停止][] 時に呼び出す関数 | ||
| | `render` | `(currentBody, newBody) => void`| [描画処理をカスタマイズする][] 用に既存の描画処理をカスタマイズする関数 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このままでも伝わりますが、説明が重複しているような気がしました。
よりシンプルにするのであれば、既存の[描画処理をカスタマイズする][]ための関数とか、もう少し説明を足すのであれば、[描画処理をカスタマイズする][] ために既存の描画処理を上書きする関数の方がしっくりくるかなと思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 0169b39
turbo/reference/events.md
Outdated
|
|
||
| ### `turbo:before-render` | ||
|
|
||
| ページの描画前に発火します。新しい `<body>` 要素は `event.detail.newBody` から取得できます。描画は `event.detail.resume` を使って停止および再開ができます(詳細は [描画の一時停止][] を参照)。さらに、Turbo ドライブがレスポンスを描画する方法は、`event.detail.render` 関数を上書きしてカスタマイズできます(詳細は [描画処理をカスタマイズする][] を参照)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最後の一文の表現がちょっと気になったので、文章の前後を入れ替えて少し自然な感じにしてみました
| ページの描画前に発火します。新しい `<body>` 要素は `event.detail.newBody` から取得できます。描画は `event.detail.resume` を使って停止および再開ができます(詳細は [描画の一時停止][] を参照)。さらに、Turbo ドライブがレスポンスを描画する方法は、`event.detail.render` 関数を上書きしてカスタマイズできます(詳細は [描画処理をカスタマイズする][] を参照)。 | |
| ページの描画前に発火します。新しい `<body>` 要素は `event.detail.newBody` から取得できます。描画は `event.detail.resume` を使って停止および再開ができます(詳細は [描画の一時停止][] を参照)。さらに `event.detail.render` 関数を上書きすることで、Turbo ドライブのレスポンス描画処理をカスタマイズできます(詳細は [描画処理をカスタマイズする][] を参照)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 576b20b
turbo/reference/events.md
Outdated
| ### `turbo:submit-end` | ||
|
|
||
| フォーム送信によって開始されたネットワークリクエストが完了した後に発火します。 | ||
| `event.detail.formSubmission` で [FormSubmission][] オブジェクトにアクセスでき、`event.detail` 内の各プロパティを参照できます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormSubmission オブジェクトから event.detail にアクセスできる??のような読み方をしてしまいました。以下のような形で並列に書くというのはいかがでしょうか。
| `event.detail.formSubmission` で [FormSubmission][] オブジェクトにアクセスでき、`event.detail` 内の各プロパティを参照できます。 | |
| `event.detail.formSubmission` で [FormSubmission][] オブジェクトにアクセスでき、その他のプロパティは `event.detail` からアクセスできます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 2859233
|
レビューありがとうございます!上から対応していきます 🙏🏾 |
|
ここまで頂いたレビューコメントの対応を行いました。 |
turbo/reference/events.md
Outdated
|
|
||
| - ナビゲーション中の `<turbo-frame>` | ||
| - 送信中の `<form>` | ||
| - ページ全体の Turbo ビジット中の `<html>` 要素 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ビジットは遷移とかで統一していた気がするので、以下のような感じはいかがでしょうか
| - ページ全体の Turbo ビジット中の `<html>` 要素 | |
| - ページ全体を対象とした Turbo 遷移中の `<html>` 要素 | |
| もしくは | |
| - Turbo によるページ遷移中の `<html>` 要素 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: f669c33 ありがとうございます。同じように Turbo Visit について言及している部分も修正しました 🙏🏾
|
ここまで頂いたレビューコメントの対応を行いました。 |
akira888
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMです!ボリュームの大きい修正をありがとうございました 🙏🏻
GitHub: GH-181