Skip to content

Tooling > TypeScript Support #53

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 2 commits into from
Sep 20, 2020

Conversation

nozomuikuta
Copy link
Member

resolves #41

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.

レビュー 👀 してコメント 💬 しました。
確認お願いします! 🙏


For developing Vue applications with TypeScript, we strongly recommend using [Visual Studio Code](https://code.visualstudio.com/), which provides great out-of-the-box support for TypeScript. If you are using [single-file components](./single-file-components.html) (SFCs), get the awesome [Vetur extension](https://github.com/vuejs/vetur), which provides TypeScript inference inside SFCs and many other great features.
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[シングルファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。
Copy link
Member

Choose a reason for hiding this comment

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

シングルファイルコンポーネント単一ファイルコンポーネント でお願いします。 現時点で日本語公式ドキュメントはそのように訳して統一しているので。

あと、awesome の訳は(多分typo?) 素晴らしい にしておきました。

Suggested change
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[シングルファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[単一ファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。

}
})
```

If you have a complex type or interface, you can cast it using [type assertion](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions):
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
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
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
複雑な型や推論の場合、[タイプアサーション (type assertions)](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:


## Using with Composition API
## コンポジション API とともに使用する
Copy link
Member

Choose a reason for hiding this comment

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

@potato4d
翻訳方針として v2 のときのガイドラインに従う形なんですが、Compostion APIという技術用語、カタカナ日本語でとりあえず、訳す方向にします?

個人的にはカタカナ日本語に訳すのは、あまり意味がない(読み方が分かる程度)のと、訳してかえってわかりにくくなるとという過去の経験から、今後としては技術用語は、原文のままとしておきたいです。

Copy link
Member

Choose a reason for hiding this comment

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

@potato4d

個人的にはカタカナ日本語に訳すのは、あまり意味がない(読み方が分かる程度)のと、訳してかえってわかりにくくなるとという過去の経験から、今後としては技術用語は、原文のままとしておきたいです。

ここで、途中から、このような形にしてしまうと、これまでの翻訳形式と一貫性がなくなってしまうので、引き続き訳すという方向で行きたいと思います。

@@ -140,9 +140,9 @@ const Component = defineComponent({
})
```

### Annotating Props
### プロパティにアノテーションをつける
Copy link
Member

Choose a reason for hiding this comment

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

ここは、プロパティ に訳さず、 Props のままとしてください。 🙏
Props としておくことで、Vue コンポーネントの props というのが読み手の分かりやすいので。

Suggested change
### プロパティにアノテーションをつける
### Props にアノテーションをつける

const result = props.message.split('') // correct, 'message' is typed as a string
const filtered = props.message.filter(p => p.value) // an error will be thrown: Property 'filter' does not exist on type 'string'
const result = props.message.split('') // 正しいです, 'message' は文字列 (string) として型づけされます
const filtered = props.message.filter(p => p.value) // エラーが起こります: 'filter' プロパティは文字列 (string) 型には存在しません。
Copy link
Member

Choose a reason for hiding this comment

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

Property 'filter' does not exist on type 'string' は TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。

@@ -206,25 +208,28 @@ const Component = defineComponent({
const year = ref(2020)

const result = year.value.split('') // => Property 'split' does not exist on type 'number'
const result = year.value.split('') // => 'split' プロパティは 'number' 型に存在しません
Copy link
Member

Choose a reason for hiding this comment

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

ここの、Property 'split' does not exist on type 'number' も同じく、TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。

const doubleCount = computed(() => count.value * 2)

const result = doubleCount.value.split('') // => Property 'split' does not exist on type 'number'
const result = doubleCount.value.split('') // => 'split' プロパティは 'number' 型に存在しません。
Copy link
Member

Choose a reason for hiding this comment

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

Property 'split' does not exist on type 'number' も同じく、TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。

@@ -258,10 +263,10 @@ export default defineComponent({
setup() {
let count = ref(0)

// read-only
// リードオンリー
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
// リードオンリー
// 読み取り専用

@netlify
Copy link

netlify bot commented Sep 20, 2020

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

Built with commit ab84ef5

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

Copy link
Member Author

@nozomuikuta nozomuikuta left a comment

Choose a reason for hiding this comment

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

@kazupon

レビューありがとうございます!
ご指摘の部分は、「Composition API」の部分を除いて修正されたと思います。

@@ -86,7 +86,7 @@ const Component = defineComponent({
})
```

複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
複雑な型や推論の場合、[タイプアサーション (type assertion)](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます:
Copy link
Member Author

Choose a reason for hiding this comment

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

こちら、原文の通り「type assertion」(単数形)を併記しました。

@@ -190,7 +190,7 @@ const Component = defineComponent({

setup(props) {
const result = props.message.split('') // 正しいです, 'message' は文字列 (string) として型づけされます
const filtered = props.message.filter(p => p.value) // エラーが起こります: 'filter' プロパティは文字列 (string) 型には存在しません。
const filtered = props.message.filter(p => p.value) // エラーが起こります: Property 'filter' does not exist on type 'string'
Copy link
Member Author

Choose a reason for hiding this comment

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

こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。

@@ -208,7 +208,6 @@ const Component = defineComponent({
const year = ref(2020)

const result = year.value.split('') // => Property 'split' does not exist on type 'number'
const result = year.value.split('') // => 'split' プロパティは 'number' 型に存在しません
Copy link
Member Author

Choose a reason for hiding this comment

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

こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。
また、翻訳の際に文を複製したものが残っていたため、削除しました。

const doubleCount = computed(() => count.value * 2)

const result = doubleCount.value.split('') // => 'split' プロパティは 'number' 型に存在しません。
const result = doubleCount.value.split('') // Property 'split' does not exist on type 'number'
Copy link
Member Author

Choose a reason for hiding this comment

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

こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。

@kazupon
Copy link
Member

kazupon commented Sep 20, 2020

@nozomuikuta
Composition API については、訳す方向にしたいと思います。
現状翻訳しているので、その内容を取り込みたいと思います。

@kazupon
Copy link
Member

kazupon commented Sep 20, 2020

CIでエラー起きているが、これは review-alert-box ラベルがないから起きている感じ。
このエラーは特に支障をきたさないので、マージする。

@kazupon kazupon merged commit 66a9801 into vuejs-jp:lang-ja Sep 20, 2020
@kazupon
Copy link
Member

kazupon commented Sep 20, 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.

Tooling > TypeScript Support の翻訳
2 participants