Skip to content

Commit af5f054

Browse files
authored
Japanese translation (Removed APIs section) (#45)
1 parent 7d1a9cb commit af5f054

File tree

7 files changed

+108
-108
lines changed

7 files changed

+108
-108
lines changed

.vitepress/locales/ja.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,20 @@ export default {
104104
]
105105
},
106106
{
107-
text: 'Removed APIs',
107+
text: '削除された API',
108108
items: [
109109
{
110-
text: 'v-on keyCode Modifiers',
110+
text: 'v-on keyCode 修飾子',
111111
link: '/ja/breaking-changes/keycode-modifiers'
112112
},
113-
{ text: 'Events API', link: '/ja/breaking-changes/events-api' },
114-
{ text: 'Filters', link: '/ja/breaking-changes/filters' },
113+
{ text: 'イベント API', link: '/ja/breaking-changes/events-api' },
114+
{ text: 'フィルター', link: '/ja/breaking-changes/filters' },
115115
{
116-
text: 'inline-template',
116+
text: 'インラインテンプレート',
117117
link: '/ja/breaking-changes/inline-template-attribute'
118118
},
119119
{ text: '$children', link: '/ja/breaking-changes/children' },
120-
{ text: 'propsData option', link: '/ja/breaking-changes/props-data' }
120+
{ text: 'propsData オプション', link: '/ja/breaking-changes/props-data' }
121121
]
122122
},
123123
{

src/ja/breaking-changes/children.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ badges:
55

66
# $children <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
The `$children` instance property has been removed from Vue 3.0 and is no longer supported.
10+
インスタンスプロパティ `$children` Vue 3.0 から削除され、サポートされなくなりました。
1111

12-
## 2.x Syntax
12+
## 2.x の構文
1313

14-
In 2.x, developers could access direct child components of the current instance with `this.$children`:
14+
2.x では、開発者は `this.$children` で現在のインスタンスの直接の子コンポーネントにアクセスできました:
1515

1616
```vue
1717
<template>
@@ -35,10 +35,10 @@ export default {
3535
</script>
3636
```
3737

38-
## 3.x Update
38+
## 3.x の更新内容
3939

40-
In 3.x, the `$children` property is removed and no longer supported. Instead, if you need to access a child component instance, we recommend using [template refs](https://ja.vuejs.org/guide/essentials/template-refs.html#template-refs).
40+
3.x では、`$children` プロパティは削除され、サポートされなくなりました。代わりに、子コンポーネントのインスタンスにアクセスする必要がある場合は、[テンプレート参照](https://ja.vuejs.org/guide/essentials/template-refs.html#template-refs)を使用することをお勧めします。
4141

42-
## Migration Strategy
42+
## 移行手順
4343

44-
[Migration build flag: `INSTANCE_CHILDREN`](../migration-build.html#compat-configuration)
44+
[移行ビルドのフラグ: `INSTANCE_CHILDREN`](../migration-build.html#compat-configuration)

src/ja/breaking-changes/events-api.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ badges:
33
- breaking
44
---
55

6-
# Events API <MigrationBadges :badges="$frontmatter.badges" />
6+
# イベント API <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
`$on`, `$off` and `$once` instance methods are removed. Component instances no longer implement the event emitter interface.
10+
`$on``$off``$once` インスタンスメソッドは削除されました。コンポーネントインスタンスはイベントエミッターインターフェースを実装しなくなりました。
1111

12-
## 2.x Syntax
12+
## 2.x の構文
1313

14-
In 2.x, a Vue instance could be used to trigger handlers attached imperatively via the event emitter API (`$on`, `$off` and `$once`). This could be used to create an _event bus_ to create global event listeners used across the whole application:
14+
2.x では、Vue インスタンスはイベントエミッターAPI(`$on``$off``$once`)を通じて、命令的にアタッチされたハンドラーをトリガーするために使用できました。これを利用して**イベントバス**を作成し、アプリケーション全体で使用するグローバルイベントリスナーを作成できます:
1515

1616
```js
1717
// eventBus.js
@@ -27,13 +27,13 @@ import eventBus from './eventBus'
2727

2828
export default {
2929
mounted() {
30-
// adding eventBus listener
30+
// eventBus のリスナーを追加
3131
eventBus.$on('custom-event', () => {
3232
console.log('Custom event triggered!')
3333
})
3434
},
3535
beforeDestroy() {
36-
// removing eventBus listener
36+
// eventBus のリスナーを削除
3737
eventBus.$off('custom-event')
3838
}
3939
}
@@ -46,40 +46,40 @@ import eventBus from './eventBus'
4646
export default {
4747
methods: {
4848
callGlobalCustomEvent() {
49-
eventBus.$emit('custom-event') // if ChildComponent is mounted, we will have a message in the console
49+
eventBus.$emit('custom-event') // ChildComponent がマウントされている場合、コンソールにメッセージが表示されます
5050
}
5151
}
5252
}
5353
```
5454

55-
## 3.x Update
55+
## 3.x の更新内容
5656

57-
We removed `$on`, `$off` and `$once` methods from the instance completely. `$emit` is still a part of the existing API as it's used to trigger event handlers declaratively attached by a parent component.
57+
インスタンスから `$on``$off``$once` メソッドを完全に削除しました。`$emit` は、親コンポーネントから宣言的にアタッチされたイベントハンドラーをトリガーするために使用されるため、依然として API の一部です。
5858

59-
## Migration Strategy
59+
## 移行手順
6060

61-
[Migration build flag: `INSTANCE_EVENT_EMITTER`](../migration-build.html#compat-configuration)
61+
[移行ビルドのフラグ: `INSTANCE_EVENT_EMITTER`](../migration-build.html#compat-configuration)
6262

63-
In Vue 3, it is no longer possible to use these APIs to listen to a component's own emitted events from within a component. There is no migration path for that use case.
63+
Vue 3 では、これらの API を使用して、コンポーネント内部からコンポーネント自身が発行したイベントを購読できなくなりました。そのユースケースのための移行経路はありません。
6464

65-
### Root Component Events
65+
### ルートコンポーネントイベント
6666

67-
Static event listeners can be added to the root component by passing them as props to `createApp`:
67+
静的なイベントリスナーは、`createApp` にプロパティとして渡すことで、ルートコンポーネントに追加できます:
6868

6969
```js
7070
createApp(App, {
71-
// Listen for the 'expand' event
71+
// 'expand' イベントを購読する
7272
onExpand() {
7373
console.log('expand')
7474
}
7575
})
7676
```
7777

78-
### Event Bus
78+
### イベントバス
7979

80-
The event bus pattern can be replaced by using an external library implementing the event emitter interface, for example [mitt](https://github.com/developit/mitt) or [tiny-emitter](https://github.com/scottcorgan/tiny-emitter).
80+
イベントバスパターンは、イベントエミッターインターフェースを実装した外部ライブラリー、例えば [mitt](https://github.com/developit/mitt) [tiny-emitter](https://github.com/scottcorgan/tiny-emitter) を使って置き換えられます。
8181

82-
Example:
82+
:
8383

8484
```js
8585
// eventBus.js
@@ -93,12 +93,12 @@ export default {
9393
}
9494
```
9595

96-
This provides the same event emitter API as in Vue 2.
96+
これは、Vue 2 と同じイベントエミッターAPI を提供します。
9797

98-
In most circumstances, using a global event bus for communicating between components is discouraged. While it is often the simplest solution in the short term, it almost invariably proves to be a maintenance headache in the long term. Depending on the circumstances, there are various alternatives to using an event bus:
98+
ほとんどの場合、コンポーネント間の通信にグローバルイベントバスを使用することは推奨されません。短期的には最も簡単な解決策であることが多いのですが、長期的には必ずと言っていいほどメンテナンスに頭を悩ませることになります。状況に応じて、イベントバスの使用にはさまざまな代替案があります:
9999

100-
* Props and events should be your first choice for parent-child communication. Siblings can communicate via their parent.
101-
* Provide / inject allow a component to communicate with its slot contents. This is useful for tightly-coupled components that are always used together.
102-
* Provide / inject can also be used for long-distance communication between components. It can help to avoid 'prop drilling', where props need to be passed down through many levels of components that don't need those props themselves.
103-
* Prop drilling can also be avoided by refactoring to use slots. If an interim component doesn't need the props then it might indicate a problem with separation of concerns. Introducing a slot in that component allows the parent to create the content directly, so that props can be passed without the interim component needing to get involved.
104-
* [Global state management](https://ja.vuejs.org/guide/scaling-up/state-management.html), such as [Pinia](https://pinia.vuejs.org/).
100+
* 親子間のコミュニケーションは、プロパティとイベントが第一候補です。兄弟要素は親を介して通信できます。
101+
* provide / inject によって、コンポーネントがそのスロットの中身と通信できるようになります。これは、常に一緒に使用される密結合のコンポーネントに便利です。
102+
* provide / inject は、コンポーネント間の長距離通信にも使用できます。これにより、あるプロパティがそのプロパティ自身を必要としない多くの階層のコンポーネントを介して渡される必要がある現象、つまり「プロパティのバケツリレー」を避けるのに役立ちます。
103+
* また、スロットを使用するようにリファクタリングすることで、プロパティのバケツリレーを回避できます。もし中間コンポーネントがプロパティを必要としないのであれば、それは関心の分離に問題があることを示している可能性があります。そのコンポーネントにスロットを導入することで、親コンポーネントが直接コンテンツを作成できるようになり、中間コンポーネントが関与することなくプロパティを渡すことができるようになります。
104+
* [Pinia](https://pinia.vuejs.org/) などの[グローバルな状態管理](https://ja.vuejs.org/guide/scaling-up/state-management.html)

src/ja/breaking-changes/filters.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ badges:
33
- removed
44
---
55

6-
# Filters <MigrationBadges :badges="$frontmatter.badges" />
6+
# フィルター <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
Filters are removed from Vue 3.0 and no longer supported.
10+
Vue 3.0 からフィルターは削除され、サポートされなくなりました。
1111

12-
## 2.x Syntax
12+
## 2.x の構文
1313

14-
In 2.x, developers could use filters in order to apply common text formatting.
14+
2.x では、開発者はフィルターを使用して、共通のテキストフォーマットを適用できました。
1515

16-
For example:
16+
例えば:
1717

1818
```html
1919
<template>
@@ -38,13 +38,13 @@ For example:
3838
</script>
3939
```
4040

41-
While this seems like a convenience, it requires a custom syntax that breaks the assumption of expressions inside curly braces being "just JavaScript," which has both learning and implementation costs.
41+
これは一見便利ですが、中括弧内の式が「ただの JavaScript」であるという前提を崩すカスタム構文が必要で、学習コストと実装コストの両方がかかります。
4242

43-
## 3.x Update
43+
## 3.x の更新内容
4444

45-
In 3.x, filters are removed and no longer supported. Instead, we recommend replacing them with method calls or computed properties.
45+
3.x ではフィルターは削除され、サポートされなくなりました。代わりに、メソッド呼び出しや算出プロパティに置き換えることをお勧めします。
4646

47-
Using the example above, here is one example of how it could be implemented.
47+
上記の例を用いて、これを実装する方法の一例を紹介します。
4848

4949
```html
5050
<template>
@@ -69,20 +69,20 @@ Using the example above, here is one example of how it could be implemented.
6969
</script>
7070
```
7171

72-
## Migration Strategy
72+
## 移行手順
7373

74-
Instead of using filters, we recommend replacing them with computed properties or methods.
74+
フィルターを使用する代わりに、算出プロパティやメソッドに置き換えることをお勧めします。
7575

76-
[Migration build flags:](../migration-build.html#compat-configuration)
76+
[移行ビルドのフラグ:](../migration-build.html#compat-configuration)
7777

7878
- `FILTERS`
7979
- `COMPILER_FILTERS`
8080

81-
### Global Filters
81+
### グローバルなフィルター
8282

83-
If you are using filters that were globally registered and then used throughout your app, it's likely not convenient to replace them with computed properties or methods in each individual component.
83+
グローバルに登録され、アプリ全体で使用されるフィルターを使用している場合、個々のコンポーネントごとに算出プロパティやメソッドに置き換えるのは不便な場合があります。
8484

85-
Instead, you can make your global filters available to all components through [globalProperties](https://ja.vuejs.org/api/application.html#app-config-globalproperties):
85+
その代わりに [globalProperties](https://ja.vuejs.org/api/application.html#app-config-globalproperties) を使って、グローバルなフィルターをすべてのコンポーネントで利用できるようにできます:
8686

8787
```js
8888
// main.js
@@ -95,7 +95,7 @@ app.config.globalProperties.$filters = {
9595
}
9696
```
9797

98-
Then you can fix all templates using this `$filters` object like this:
98+
そして以下のように、この `$filters` オブジェクトを使ってすべてのテンプレートを修正できます:
9999

100100
```html
101101
<template>
@@ -104,4 +104,4 @@ Then you can fix all templates using this `$filters` object like this:
104104
</template>
105105
```
106106

107-
Note that with this approach, you can only use methods, not computed properties, as the latter only make sense when defined in the context of an individual component.
107+
この方法では算出プロパティは使用できず、メソッドのみを使用できることに注意してください。算出プロパティは個々のコンポーネントの文脈で定義されたときにのみ意味を持つからです。

src/ja/breaking-changes/inline-template-attribute.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ badges:
33
- breaking
44
---
55

6-
# Inline Template Attribute <MigrationBadges :badges="$frontmatter.badges" />
6+
# インラインテンプレート属性 <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
Support for the [inline-template feature](https://v2.ja.vuejs.org/v2/guide/components-edge-cases#%E3%82%A4%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88) has been removed.
10+
[インラインテンプレート機能](https://v2.ja.vuejs.org/v2/guide/components-edge-cases#%E3%82%A4%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88)のサポートは削除されました。
1111

12-
## 2.x Syntax
12+
## 2.x の構文
1313

14-
In 2.x, Vue provided the `inline-template` attribute on child components to use its inner content as its template instead of treating it as distributed content.
14+
2.x では、Vue は子コンポーネントに `inline-template` 属性を提供し、その内容を(配布するコンテンツとして扱うのではなく)テンプレートとして使用できました。
1515

1616
```html
1717
<my-component inline-template>
@@ -22,27 +22,27 @@ In 2.x, Vue provided the `inline-template` attribute on child components to use
2222
</my-component>
2323
```
2424

25-
## 3.x Syntax
25+
## 3.x の構文
2626

27-
This feature will no longer be supported.
27+
この機能は今後サポートされません。
2828

29-
## Migration Strategy
29+
## 移行手順
3030

31-
Most of the use cases for `inline-template` assumes a no-build-tool setup, where all templates are written directly inside the HTML page.
31+
`inline-template` のユースケースのほとんどは、すべてのテンプレートが HTML ページの中に直接書かれる、ビルドツールのないセットアップを想定しています。
3232

33-
[Migration build flag: `COMPILER_INLINE_TEMPLATE`](../migration-build.html#compat-configuration)
33+
[移行ビルドのフラグ: `COMPILER_INLINE_TEMPLATE`](../migration-build.html#compat-configuration)
3434

35-
### Option #1: Use `<script>` tag
35+
### 選択肢 #1: `<script>` タグを使用する
3636

37-
The most straightforward workaround in such cases is using `<script>` with an alternative type:
37+
このような場合の最も簡単な回避策は、代替の type 属性で `<script>` を使うことです:
3838

3939
```html
4040
<script type="text/html" id="my-comp-template">
4141
<div>{{ hello }}</div>
4242
</script>
4343
```
4444

45-
And in the component, target the template using a selector:
45+
そしてコンポーネントでは、セレクターを使ってテンプレートをターゲットにします:
4646

4747
```js
4848
const MyComp = {
@@ -51,34 +51,34 @@ const MyComp = {
5151
}
5252
```
5353

54-
This doesn't require any build setup, works in all browsers, is not subject to any in-DOM HTML parsing caveats (e.g. you can use camelCase prop names), and provides proper syntax highlighting in most IDEs. In traditional server-side frameworks, these templates can be split out into server template partials (included into the main HTML template) for better maintainability.
54+
これは、ビルドのセットアップを必要とせず、すべてのブラウザーで動作し、DOM 内の HTML パースの注意点(例えば、camelCase のプロパティ名を使用できる)に左右されず、ほとんどの IDE で適切なシンタックスハイライトを提供します。従来のサーバーサイドフレームワークでは、これらのテンプレートは保守性を高めるために、サーバーテンプレートのパーシャル(メインの HTML テンプレートに含まれる)に分割できます。
5555

56-
### Option #2: Default Slot
56+
### 選択肢 #2: デフォルトスロット
5757

58-
A component previously using `inline-template` can also be refactored using the default slot - which makes the data scoping more explicit while preserving the convenience of writing child content inline:
58+
これまで `inline-template` を使用していたコンポーネントも、デフォルトのスロットを使用してリファクタリングできます。これにより、子コンテンツをインラインで記述する利便性を維持しつつ、データのスコープがより明確になります:
5959

6060
```html
61-
<!-- 2.x Syntax -->
61+
<!-- 2.x の構文 -->
6262
<my-comp inline-template :msg="parentMsg">
6363
{{ msg }} {{ childState }}
6464
</my-comp>
6565

66-
<!-- Default Slot Version -->
66+
<!-- デフォルトスロットバージョン -->
6767
<my-comp v-slot="{ childState }">
6868
{{ parentMsg }} {{ childState }}
6969
</my-comp>
7070
```
7171

72-
The child, instead of providing no template, should now render the default slot\*:
72+
子コンポーネントは、テンプレートを提供しない代わりに、デフォルトスロット\*をレンダリングする必要があります:
7373

7474
```html
7575
<!--
76-
in child template, render default slot while passing
77-
in necessary private state of child.
76+
子のテンプレートでは、必要な子コンポーネントのプライベート状態を渡しつつ、
77+
デフォルトスロットをレンダリングします
7878
-->
7979
<template>
8080
<slot :childState="childState" />
8181
</template>
8282
```
8383

84-
> - Note: In 3.x, slots can be rendered as the root with native [fragments](../new/fragments) support!
84+
> - 注意: 3.x では、ネイティブの [fragments](../new/fragments) サポートにより、スロットをルートとしてレンダリングすることができます!

0 commit comments

Comments
 (0)