Skip to content

Commit 59ae855

Browse files
authored
docs:translate guide/a11y-semantics (#85)
* docs:translate guide/ally-semantics * small fix: space and typo * translate alt text, and change word: instructions
1 parent aa0ffff commit 59ae855

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

src/guide/a11y-semantics.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Semantics
1+
# セマンティクス
22

3-
## Forms
3+
## フォーム
44

5-
When creating a form, you can use the following elements: `<form>`, `<label>`, `<input>`, `<textarea>`, and `<button>`
5+
フォームを作成するとき、以下の要素を使用することができます: `<form>``<label>``<input>``<textarea>` 、そして `<button>` です。
66

7-
Labels are typically placed on top or to the left of the form fields:
7+
ラベルは一般的にフォームの上部または左側に配置します。
88

99
```html
1010
<form action="/dataCollectionLocation" method="post" autocomplete="on">
@@ -28,11 +28,11 @@ Labels are typically placed on top or to the left of the form fields:
2828
</p>
2929
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
3030

31-
Notice how you can include `autocomplete='on'` on the form element and it will apply to all inputs in your form. You can also set different [values for autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for each input.
31+
どのように `autocomplete='on'` をフォーム要素上に含むことができるかに注目してください。そしてそれはフォーム内の全ての入力欄に適用されます。また各入力欄の [autocomplete 属性に対して異なる値](https://developer.mozilla.org/ja/docs/Web/HTML/Attributes/autocomplete)をセットすることもできます。
3232

33-
### Labels
33+
### ラベル
3434

35-
Provide labels to describe the purpose of all form control; linking `for` and `id`:
35+
全てのフォームコントロールの目的を説明するためにラベルを提供してください。`for` `id` はリンクしています:
3636

3737
```html
3838
<label for="name">Name</label>
@@ -46,12 +46,12 @@ Provide labels to describe the purpose of all form control; linking `for` and `i
4646
</p>
4747
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
4848

49-
If you inspect this element in your chrome developer tools and open the Accessibility tab inside the Elements tab, you will see how the input gets its name from the label:
49+
chrome デベロッパツールでこの要素を検証し、Elements タブ内の Accessibility タブを開くと、どのように入力欄がその名前をラベルから取得するかを確認できます:
5050

51-
![Chrome Developer Tools showing input accessible name from label](/images/AccessibleLabelChromeDevTools.png)
51+
![label からアクセス可能な入力欄の名前を表示する Chrome デベロッパツール](/images/AccessibleLabelChromeDevTools.png)
5252

5353
:::warning Warning:
54-
Though you might have seen labels wrapping the input fields like this:
54+
以下のように入力欄をラップしているラベルを見たことがあるかもしれません:
5555

5656
```html
5757
<label>
@@ -60,12 +60,12 @@ Though you might have seen labels wrapping the input fields like this:
6060
</label>
6161
```
6262

63-
Explicitly setting the labels with an matching id is better supported by assistive technology.
63+
一致する id で明示的にラベルを設定することは支援技術によってより適切にサポートされます。
6464
:::
6565

6666
#### aria-label
6767

68-
You can also give the input an accessible name with [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).
68+
[`aria-label`](https://developer.mozilla.org/ja/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) によりアクセス可能な名前を入力欄に付与することもできます。
6969

7070
```html
7171
<label for="name">Name</label>
@@ -85,13 +85,13 @@ You can also give the input an accessible name with [`aria-label`](https://devel
8585
</p>
8686
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
8787

88-
Feel free to inspect this element in Chrome DevTools to see how the accessible name has changed:
88+
この要素を Chrome DevTools で自由に検証し、どのようにアクセス可能な名前が変更されたか確認してください:
8989

90-
![Chrome Developer Tools showing input accessible name from aria-label](/images/AccessibleARIAlabelDevTools.png)
90+
![aria-label からアクセス可能な入力欄の名前を表示する Chrome デベロッパツール](/images/AccessibleARIAlabelDevTools.png)
9191

9292
#### aria-labelledby
9393

94-
Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) is similar to `aria-label` expect it is used if the label text is visible on screen. It is paired to other elements by their `id` and you can link multiple `id`s:
94+
[`aria-labelledby`](https://developer.mozilla.org/ja/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) `aria-label` に類似しており、ラベルテキストが画面に表示されている場合に使用されることを期待します。これは `id` によって他の要素とペアになっており、複数の `id` を関連付けることができます:
9595

9696
```html
9797
<form
@@ -122,11 +122,11 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi
122122
</p>
123123
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
124124

125-
![Chrome Developer Tools showing input accessible name from aria-labelledby](/images/AccessibleARIAlabelledbyDevTools.png)
125+
![aria-labelledby からアクセス可能な入力欄の名前を表示する Chrome デベロッパツール](/images/AccessibleARIAlabelledbyDevTools.png)
126126

127127
#### aria-describedby
128128

129-
[aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) is used the same way as `aria-labelledby` expect provides a description with additional information that the user might need. This can be used to describe the criteria for any input:
129+
[aria-describedby](https://developer.mozilla.org/ja/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) `aria-labelledby` と同じ方法で使用され、ユーザが必要とする可能性のある追加情報と説明を提供します。これは任意の入力欄の基準を説明するために使用することができます:
130130

131131
```html
132132
<form
@@ -159,15 +159,15 @@ Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibi
159159
</p>
160160
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
161161

162-
You can see the description by instecting Chrome DevTools:
162+
Chrome DevTools で検出することで Description を確認することができます:
163163

164-
![Chrome Developer Tools showing input accessible name from aria-labelledby and description with aria-describedby](/images/AccessibleARIAdescribedby.png)
164+
![aria-labelledby と aria-describedby を含む description からアクセス可能な入力欄の名前を表示する Chrome デベロッパツール](/images/AccessibleARIAdescribedby.png)
165165

166-
### Placeholder
166+
### プレースホルダ
167167

168-
Avoid using placeholders as they can confuse many users.
168+
多くのユーザが混乱する可能性があるため、プレースホルダの使用は避けてください。
169169

170-
One of the issues with placeholders is that they don't meet the [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) by default; fixing the color contrast makes the placeholder look like pre-populated data in the input fields. Looking at the following example, you can see that the Last Name placeholder which meets the color contrast criteria looks like pre-populated data:
170+
プレースホルダによる問題の1つは初期状態で [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) を満たしていないことです。色のコントラストを修正するとプレースホルダが入力欄に事前入力されたデータのように見えます。以下の例を見ると、color contrast criteria を満たしている Last Name プレースホルダが事前入力されたデータのように見えることが確認できます:
171171

172172
<p class="codepen" data-height="265" data-theme-id="light" data-default-tab="js,result" data-user="mlama007" data-slug-hash="PoZJzeQ" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Form Placeholder">
173173
<span>See the Pen <a href="https://codepen.io/mlama007/pen/PoZJzeQ">
@@ -176,12 +176,12 @@ One of the issues with placeholders is that they don't meet the [color contrast
176176
</p>
177177
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
178178

179-
It is best to provide all the information the user needs to fill out forms outside any inputs.
179+
ユーザがフォームを入力するために必要とするすべての情報を入力欄の外側で提供するのが最善です。
180180

181-
### Instructions
181+
### 説明
182182

183-
When adding instructions for your input fields, make sure to link it correctly to the input.
184-
You can provide additional instructions and bind multiple ids inside an [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute). This allows for more flexible design.
183+
入力欄に説明を追加するとき、入力欄に対して正しくリンクしていることを確認してください。
184+
あなたは追加の説明を提供し、複数の id を [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) 内に束縛することができます。これにより、さらに柔軟な設計が可能になります。
185185

186186
```html
187187
<fieldset>
@@ -197,7 +197,7 @@ You can provide additional instructions and bind multiple ids inside an [`aria-l
197197
</fieldset>
198198
```
199199

200-
Alternatively, you can attach the instructions to the input with [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute):
200+
あるいは、[`aria-describedby`](https://developer.mozilla.org/ja/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute) を使用して入力欄に説明を添付することもできます:
201201

202202
```html
203203
<fieldset>
@@ -215,11 +215,11 @@ Alternatively, you can attach the instructions to the input with [`aria-describe
215215
</p>
216216
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
217217

218-
### Hiding Content
218+
### コンテンツの非表示
219219

220-
Usually it is not recommended to visually hide labels, even if the input has an accessible name. However, if the functionality of the input can be understood with surrounding content, then we can hide the visual label.
220+
入力欄がアクセス可能な名前を持っている場合でも、視覚的にラベルを非表示にすることは非推奨です。しかし、入力欄の機能が周囲のコンテンツから理解できる場合は、視覚的なラベルを非表示にすることができます。
221221

222-
Let's look at this search field:
222+
以下の検索フィールドを見てみましょう:
223223

224224
```html
225225
<form role="search">
@@ -229,9 +229,9 @@ Let's look at this search field:
229229
</form>
230230
```
231231

232-
We can do this because the search button will help visual users identify the purpose of the input field.
232+
これができるのは、検索ボタンが視覚的にユーザが入力欄の目的を特定を助けるためです。
233233

234-
We can use CSS to visually hide elements but keep them available for assistive technology:
234+
CSSを使用して要素を視覚的に非表示にすることができますが、それらを支援技術で利用できるようにしておきます:
235235

236236
```css
237237
.hidden-visually {
@@ -256,17 +256,17 @@ We can use CSS to visually hide elements but keep them available for assistive t
256256

257257
#### aria-hidden="true"
258258

259-
Adding `aria-hidden="true"` will hide the element from assistive technology but leave it visually available for other users. Do not use it on focusable elements, purely on decorative, duplicated or offscreen content.
259+
`aria-hidden="true"` を追加すると要素は支援技術から隠されますが、他のユーザから視覚的に利用可能になります。フォーカス可能な要素や、純粋に装飾的なコンテンツ、複製されたコンテンツ、または画面外のコンテンツには使用しないでください。
260260

261261
```html
262262
<p>This is not hidden from screen readers.</p>
263263
<p aria-hidden="true">This is hidden from screen readers.</p>
264264
```
265265

266-
### Buttons
266+
### ボタン
267267

268-
When using buttons inside a form, you must set the type to prevent submitting the form.
269-
You can also use an input to create buttons:
268+
フォーム内でボタンを使用するときは、フォームの送信をしないようにタイプを設定する必要があります。
269+
入力欄を使用してボタンを作ることもできます:
270270

271271
```html
272272
<form action="/dataCollectionLocation" method="post" autocomplete="on">
@@ -287,13 +287,13 @@ You can also use an input to create buttons:
287287
</p>
288288
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
289289

290-
#### Functional Images
290+
#### 機能的な画像
291291

292-
You can use this technique to create functional images.
292+
機能的な画像を作るために次の技術を使うことができます。
293293

294-
- Input fields
294+
- 入力欄
295295

296-
- These images will act as a submit type button on forms
296+
- これらの画像はフォーム上の送信タイプのボタンとして機能します
297297

298298
```html
299299
<form role="search">
@@ -308,7 +308,7 @@ You can use this technique to create functional images.
308308
</form>
309309
```
310310

311-
- Icons
311+
- アイコン
312312

313313
```html
314314
<form role="search">

0 commit comments

Comments
 (0)