Skip to content

Commit 66b7202

Browse files
authored
Japanese translation (Other Minor Changes section 1) (#47)
1 parent af5f054 commit 66b7202

File tree

7 files changed

+134
-134
lines changed

7 files changed

+134
-134
lines changed

.vitepress/locales/ja.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,23 @@ export default {
121121
]
122122
},
123123
{
124-
text: 'Other Minor Changes',
124+
text: 'その他の細かい変更',
125125
items: [
126126
{
127-
text: 'Attribute Coercion Behavior',
127+
text: '属性の強制変換',
128128
link: '/ja/breaking-changes/attribute-coercion'
129129
},
130130
{
131-
text: 'Custom Directives',
131+
text: 'カスタムディレクティブ',
132132
link: '/ja/breaking-changes/custom-directives'
133133
},
134-
{ text: 'Data Option', link: '/ja/breaking-changes/data-option' },
134+
{ text: 'data オプション', link: '/ja/breaking-changes/data-option' },
135135
{
136-
text: 'Mount API changes',
136+
text: 'マウント API の変更',
137137
link: '/ja/breaking-changes/mount-changes'
138138
},
139139
{
140-
text: 'Props Default Function this Access',
140+
text: 'プロパティ default 関数の this アクセス',
141141
link: '/ja/breaking-changes/props-default-this'
142142
},
143143
{

src/breaking-changes/attribute-coercion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ In 3.x, `null` or `undefined` should be used to explicitly remove an attribute.
125125
<td><code>"false"</code></td>
126126
</tr>
127127
<tr>
128-
<td rowspan="2">Other non-boolean attrs<br><small>eg. <code>aria-checked</code>, <code>tabindex</code>, <code>alt</code>, etc.</small></td>
128+
<td rowspan="2">Other non-boolean attrs<br><small>e.g. <code>aria-checked</code>, <code>tabindex</code>, <code>alt</code>, etc.</small></td>
129129
<td><code>undefined</code>, <code>null</code>, <code>false</code></td>
130130
<td><code>undefined</code>, <code>null</code></td>
131131
<td><i>removed</i></td>

src/ja/breaking-changes/attribute-coercion.md

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

6-
# Attribute Coercion Behavior <MigrationBadges :badges="$frontmatter.badges" />
6+
# 属性の強制変換 <MigrationBadges :badges="$frontmatter.badges" />
77

8-
::: info Info
9-
This is a low-level internal API change and does not affect most developers.
8+
::: info 情報
9+
これは、低レベルの内部 API の変更であり、ほとんどの開発者には影響しません。
1010
:::
1111

12-
## Overview
12+
## 概要
1313

14-
Here is a high level summary of the changes:
14+
変更点の概要は次のとおりです:
1515

16-
- Drop the internal concept of enumerated attributes and treat those attributes the same as normal non-boolean attributes
17-
- **BREAKING**: No longer removes attribute if the value is boolean `false`. Instead, it's set as attr="false". To remove the attribute, use `null` or `undefined`.
16+
- 列挙型属性の内部概念を削除し、これらの属性を真偽値でない通常の属性と同じように扱います
17+
- **破壊的変更**: 値が真偽値の `false` の場合、属性を削除しないようにしました。代わりに、attr="false "として設定されます。属性を削除するには、`null` または `undefined` を使用します。
1818

19-
For more information, read on!
19+
詳細については続きをお読みください!
2020

21-
## 2.x Syntax
21+
## 2.x の構文
2222

23-
In 2.x, we had the following strategies for coercing `v-bind` values:
23+
2.x では、`v-bind` の値を強制変換するために、以下のような戦略をとっていました:
2424

25-
- For some attribute/element pairs, Vue is always using the corresponding IDL attribute (property): [like `value` of `<input>`, `<select>`, `<progress>`, etc](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L11-L18).
25+
- 属性と要素のペアによっては、Vue は常に対応する IDL 属性(プロパティ)を使用します。これは [`<input>``<select>``<progress>` などにおける `value`](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L11-L18) などです。
2626

27-
- For "[boolean attributes](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L33-L40)" and [xlinks](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L44-L46), Vue removes them if they are "falsy" ([`undefined`, `null` or `false`](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L52-L54)) and adds them otherwise (see [here](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L66-L77) and [here](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L81-L85)).
27+
- [真偽値属性](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L33-L40)」と「[xlink](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L44-L46)」の場合、Vue "falsy"[`undefined``null``false`](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L52-L54))であれば削除し、それ以外は追加します([ここ](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L66-L77)[ここ](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L81-L85)を参照)。
2828

29-
- For "[enumerated attributes](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L20)" (currently `contenteditable`, `draggable` and `spellcheck`), Vue tries to [coerce](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L24-L31) them to string (with special treatment for `contenteditable` for now, to fix [vuejs/vue#9397](https://github.com/vuejs/vue/issues/9397)).
29+
- [列挙型属性](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L20)」(現在は `contenteditable``dragable``spellcheck`)の場合、Vue はそれらを文字列に[強制変換](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/util/attrs.js#L24-L31)しようとします([vuejs/vue#9397](https://github.com/vuejs/vue/issues/9397) を修正するため、今のところ `contenteditable` については特別扱いしています)。
3030

31-
- For other attributes, we remove "falsy" values (`undefined`, `null`, or `false`) and set other values as-is (see [here](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L92-L113)).
31+
- その他の属性の場合、"falsy" な値(`undefined``null``false`)は削除し、その他の値はそのまま設定します([こちら](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L92-L113)を参照)。
3232

33-
The following table describes how Vue coerce "enumerated attributes" differently with normal non-boolean attributes:
33+
次の表は、Vue が「列挙型属性」を真偽値でない通常の属性とは異なる方法で強制変換する方法を示しています:
3434

35-
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
35+
| バインドする式 | `foo` <sup>通常</sup> | `draggable` <sup>列挙型</sup> |
3636
| ------------------- | ----------------------- | --------------------------------- |
3737
| `:attr="null"` | - | `draggable="false"` |
3838
| `:attr="undefined"` | - | - |
@@ -43,22 +43,22 @@ The following table describes how Vue coerce "enumerated attributes" differently
4343
| `attr="foo"` | `foo="foo"` | `draggable="true"` |
4444
| `attr` | `foo=""` | `draggable="true"` |
4545

46-
We can see from the table above, current implementation coerces `true` to `'true'` but removes the attribute if it's `false`. This also led to inconsistency and required users to manually coerce boolean values to string in very common use cases like `aria-*` attributes like `aria-selected`, `aria-hidden`, etc.
46+
上の表からわかるように、現在の実装では `true` `'true'` に強制変換されますが、`false` の場合は属性が削除されます。これは不一致を引き起こし、`aria-*` 属性(`aria-selected``aria-hidden` など)のような非常に一般的なユースケースでは、真偽値を手動で文字列に変換する必要がありました。
4747

48-
## 3.x Syntax
48+
## 3.x の構文
4949

50-
We intend to drop this internal concept of "enumerated attributes" and treat them as normal non-boolean HTML attributes.
50+
この「列挙型属性」という内部概念を削除して、真偽値でない通常の HTML 属性として扱う予定です。
5151

52-
- This solves the inconsistency between normal non-boolean attributes and “enumerated attributes”
53-
- It also makes it possible to use values other than `'true'` and `'false'`, or even keywords yet to come, for attributes like `contenteditable`
52+
- これにより、真偽値でない通常の属性と「列挙型属性」の間の不一致が解消されます。
53+
- また、`contenteditable` のような属性には、`'true'` `'false'` 以外の値や、あるいはまだないキーワードを使用できるようになります。
5454

55-
For non-boolean attributes, Vue will stop removing them if they are `false` and coerce them to `'false'` instead.
55+
真偽値でない属性については、Vue `false` の場合に削除するのではなく、`'false'` に強制変換します。
5656

57-
- This solves the inconsistency between `true` and `false` and makes outputting `aria-*` attributes easier
57+
- これにより、`true` `false` での不一致が解消され、`aria-*` 属性の出力が容易になります
5858

59-
The following table describes the new behavior:
59+
次の表は、新しい動作について説明したものです:
6060

61-
| Binding expression | `foo` <sup>normal</sup> | `draggable` <sup>enumerated</sup> |
61+
| バインドする式 | `foo` <sup>通常</sup> | `draggable` <sup>列挙型</sup> |
6262
| ------------------- | -------------------------- | --------------------------------- |
6363
| `:attr="null"` | - | - <sup>*</sup> |
6464
| `:attr="undefined"` | - | - |
@@ -69,47 +69,47 @@ The following table describes the new behavior:
6969
| `attr="foo"` | `foo="foo"` | `draggable="foo"` <sup>*</sup> |
7070
| `attr` | `foo=""` | `draggable=""` <sup>*</sup> |
7171

72-
<small>*: changed</small>
72+
<small>*: 変更箇所</small>
7373

74-
Coercion for boolean attributes is left untouched.
74+
真偽値属性の強制変換についてはそのままです。
7575

76-
## Migration Strategy
76+
## 移行手順
7777

78-
### Enumerated attributes
78+
### 列挙型属性
7979

80-
The absence of an enumerated attribute and `attr="false"` may produce different IDL attribute values (which will reflect the actual state), described as follows:
80+
列挙型属性がなかったり `attr="false"` の場合、以下のように異なる IDL 属性値(実際の状態を反映する)が得られることがあります:
8181

82-
| Absent enumerated attr | IDL attr & value |
82+
| 設定されていない列挙型属性 | IDL 属性と値 |
8383
| ---------------------- | ------------------------------------ |
8484
| `contenteditable` | `contentEditable` &rarr; `'inherit'` |
8585
| `draggable` | `draggable` &rarr; `false` |
8686
| `spellcheck` | `spellcheck` &rarr; `true` |
8787

88-
Since we no longer coerce `null` to `'false'` for “enumerated properties” in 3.x, in the case of `contenteditable` and `spellcheck`, developers will need to change those `v-bind` expressions that used to resolve to `null` to resolve to `false` or `'false'` in order to maintain the same behavior as 2.x.
88+
3.x では、`contentitable``spellcheck` のような「列挙型プロパティ」に対して `null` `'false'` に強制変換することがなくなったため、2.x と同じ動作を維持するには、開発者はこれまで `null` に解決していたこれらの `v-bind` 式を `false` または `'false'` に変更しなければならないでしょう。
8989

90-
In 2.x, invalid values were coerced to `'true'` for enumerated attributes. This was usually unintended and unlikely to be relied upon on a large scale. In 3.x `true` or `'true'` should be explicitly specified.
90+
2.x では、列挙型属性に対して無効な値が強制的に `'true'` に変換されていました。これは通常、意図しないものであり、大規模に依存する可能性は低いです。3.x では `true` または `'true'` を明示的に指定する必要があります。
9191

92-
### Coercing `false` to `'false'` instead of removing the attribute
92+
### 属性を削除する代わりに `false` `'false'` に強制変換する
9393

94-
In 3.x, `null` or `undefined` should be used to explicitly remove an attribute.
94+
3.x では、属性を明示的に削除するには `null` または `undefined` を使用する必要があります。
9595

96-
### Comparison between 2.x & 3.x behavior
96+
### 2.x 3.x の動作の比較
9797

9898
<table>
9999
<thead>
100100
<tr>
101-
<th>Attribute</th>
102-
<th><code>v-bind</code> value <sup>2.x</sup></th>
103-
<th><code>v-bind</code> value <sup>3.x</sup></th>
104-
<th>HTML output</th>
101+
<th>属性</th>
102+
<th><code>v-bind</code> の値 <sup>2.x</sup></th>
103+
<th><code>v-bind</code> の値 <sup>3.x</sup></th>
104+
<th>HTML<br/>出力</th>
105105
</tr>
106106
</thead>
107107
<tbody>
108108
<tr>
109-
<td rowspan="3">2.x “Enumerated attrs”<br><small>i.e. <code>contenteditable</code>, <code>draggable</code> and <code>spellcheck</code>.</small></td>
109+
<td rowspan="3">2.x の「列挙型属性」<br><small>例: <code>contenteditable</code>, <code>draggable</code>, <code>spellcheck</code></small></td>
110110
<td><code>undefined</code></td>
111111
<td><code>undefined</code>, <code>null</code></td>
112-
<td><i>removed</i></td>
112+
<td><i>除去</i></td>
113113
</tr>
114114
<tr>
115115
<td>
@@ -125,10 +125,10 @@ In 3.x, `null` or `undefined` should be used to explicitly remove an attribute.
125125
<td><code>"false"</code></td>
126126
</tr>
127127
<tr>
128-
<td rowspan="2">Other non-boolean attrs<br><small>eg. <code>aria-checked</code>, <code>tabindex</code>, <code>alt</code>, etc.</small></td>
128+
<td rowspan="2">その他の真偽値でない属性<br><small>例: <code>aria-checked</code>, <code>tabindex</code>, <code>alt</code> など</small></td>
129129
<td><code>undefined</code>, <code>null</code>, <code>false</code></td>
130130
<td><code>undefined</code>, <code>null</code></td>
131-
<td><i>removed</i></td>
131+
<td><i>除去</i></td>
132132
</tr>
133133
<tr>
134134
<td><code>'false'</code></td>
@@ -138,7 +138,7 @@ In 3.x, `null` or `undefined` should be used to explicitly remove an attribute.
138138
</tbody>
139139
</table>
140140

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

143143
- `ATTR_FALSE_VALUE`
144144
- `ATTR_ENUMERATED_COERCION`

0 commit comments

Comments
 (0)