Skip to content

docs #26 Reusability & Composition > Custom Directives の翻訳 #68

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

Merged
merged 4 commits into from
Sep 26, 2020

Conversation

egurinko
Copy link
Collaborator

resolved #26

@netlify
Copy link

netlify bot commented Sep 20, 2020

Deploy preview for vuejs-v3-ja-doc-preview ready!

Built with commit ee56f74

https://deploy-preview-68--vuejs-v3-ja-doc-preview.netlify.app

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レビュー 👀 コメント 💬 しました!
翻訳内容はほぼ完璧です!

ほとんどは細かい内容のものですが、対応お願いします! 🙏


Now let's build the directive that accomplishes this:
ここからこれを実現するディレクティブを実装しましょう。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: ですが、これまでの Vue 公式ドキュメントの翻訳ではそのまま載せてきたので、ここでは句点ではなく : でお願いします! 🙏

Suggested change
ここからこれを実現するディレクティブを実装しましょう
ここからこれを実現するディレクティブを実装しましょう:

Copy link
Collaborator Author

@egurinko egurinko Sep 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご指摘ありがとうございます!
2504960 にてまとめて修正を入れさせていただきました 🙏

mounted(el) {
el.focus()
}
}
}
```

Then in a template, you can use the new `v-focus` attribute on any element, like this:
そしてテンプレートでは、新規登録した `v-focus` 属性をどの要素に対しても以下のように利用できます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも同じく :

Suggested change
そしてテンプレートでは、新規登録した `v-focus` 属性をどの要素に対しても以下のように利用できます
そしてテンプレートでは、新規登録した `v-focus` 属性をどの要素に対しても以下のように利用できます:

app.directive('focus', {
// When the bound element is mounted into the DOM...
// バインドされている要素が DOM にマウントされると...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これまでの Vue 公式ドキュメントの翻訳では、bind束縛 で訳してきているの、こちらでお願いしいます! 🙏

Suggested change
// バインドされている要素が DOM にマウントされると...
// 束縛されている要素が DOM にマウントされると...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

承知しました!
こちら 63bedfb にてまとめて修正させていただきました 🙋


- `beforeMount`: called when the directive is first bound to the element and before parent component is mounted. This is where you can do one-time setup work.
- `beforeMount`: ディレクティブが初めて要素にバインドされた時、そして親コンポーネントがマウントされる前に呼ばれます。ここは1度だけ実行するセットアップ処理を行える場所です。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
- `beforeMount`: ディレクティブが初めて要素にバインドされた時、そして親コンポーネントがマウントされる前に呼ばれます。ここは1度だけ実行するセットアップ処理を行える場所です。
- `beforeMount`: ディレクティブが初めて要素に束縛された時、そして親コンポーネントがマウントされる前に呼ばれます。ここは1度だけ実行するセットアップ処理を行える場所です。


- `mounted`: called when the bound element's parent component is mounted.
- `mounted`: バインドされた要素の親コンポーネントがマウントされた時に呼ばれます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
- `mounted`: バインドされた要素の親コンポーネントがマウントされた時に呼ばれます
- `mounted`: 束縛された要素の親コンポーネントがマウントされた時に呼ばれます


:::tip Note
We'll cover VNodes in more detail [later](render-function.html#the-virtual-dom-tree), when we discuss render functions.
:::tip 注意
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VuePress の ::: のやつですが、以下でも質問がありましたが、一旦翻訳しない方向に決めました。
#1 (comment)
ですので、そのままにしておいてください。 🙏

Suggested change
:::tip 注意
:::tip Note

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど!ご指摘ありがとうございます!
こちらも原文表示に修正しました!
ee56f74

:::

- `updated`: called after the containing component's VNode **and the VNodes of its children** have updated.
- `updated`: バインドされた要素を含むコンポーネントの VNode **とその子コンポーネントの VNode** が更新された後に呼ばれます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
- `updated`: バインドされた要素を含むコンポーネントの VNode **とその子コンポーネントの VNode** が更新された後に呼ばれます。
- `updated`: 束縛された要素を含むコンポーネントの VNode **とその子コンポーネントの VNode** が更新された後に呼ばれます。


- `beforeUnmount`: called before the bound element's parent component is unmounted
- `beforeUnmount`: バインドされた要素の親コンポーネントがアンマウントされる前に呼ばれます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
- `beforeUnmount`: バインドされた要素の親コンポーネントがアンマウントされる前に呼ばれます
- `beforeUnmount`: 束縛された要素の親コンポーネントがアンマウントされる前に呼ばれます


- `unmounted`: called only once, when the directive is unbound from the element and the parent component is unmounted.
- `unmounted`: ディレクティブが要素からバインドを解かれた時、また親コンポーネントがアンマウントされた時に1度だけ呼ばれます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
- `unmounted`: ディレクティブが要素からバインドを解かれた時、また親コンポーネントがアンマウントされた時に1度だけ呼ばれます。
- `unmounted`: ディレクティブが要素から束縛されなくなった時、また親コンポーネントがアンマウントされた時に1度だけ呼ばれます。

@@ -134,7 +134,7 @@ Result:
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

Our custom directive is now flexible enough to support a few different use cases. To make it even more dynamic, we can also allow to modify a bound value. Let's create an additional property `pinPadding` and bind it to the `<input type="range">`
このカスタムディレクティブは、いくつかの違うユースケースをサポートできるほど柔軟になりました。さらに動的にするには、バインドした値を修正できるようにすれば良いでしょう。`pinPadding` という追加のプロパティを作成して、`<input type="range">` にバインドしてみましょう。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの bind も同じく。

Suggested change
このカスタムディレクティブは、いくつかの違うユースケースをサポートできるほど柔軟になりました。さらに動的にするには、バインドした値を修正できるようにすれば良いでしょう`pinPadding` という追加のプロパティを作成して、`<input type="range">` にバインドしてみましょう
このカスタムディレクティブは、いくつかの違うユースケースをサポートできるほど柔軟になりました。さらに動的にするには、束縛した値を修正できるようにすれば良いでしょう`pinPadding` という追加のプロパティを作成して、`<input type="range">` に束縛してみましょう

@egurinko
Copy link
Collaborator Author

レビュー 👀 コメント 💬 しました!
翻訳内容はほぼ完璧です!

ほとんどは細かい内容のものですが、対応お願いします! 🙏

細かくレビューいただきありがとうございました!
対応完了いたしました!

@kazupon
Copy link
Member

kazupon commented Sep 26, 2020

指摘事項の対応ありがとうございました!
確認しました!
LGTMです!

CIでエラーが起きていますが、翻訳作業に支障はない(このPRとは別事象)ので、マージします!

翻訳ありがとうございました!

@kazupon kazupon merged commit 05f8ab9 into vuejs-jp:lang-ja Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reusability & Composition > Custom Directives の翻訳
2 participants