Skip to content

Commit 2846d29

Browse files
committed
translate 01-svelte/01-introduction into Japanese
1 parent 202f228 commit 2846d29

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

content/tutorial/01-svelte/01-introduction/03-dynamic-attributes/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
title: Dynamic attributes
33
---
44

5-
Just like you can use curly braces to control text, you can use them to control element attributes.
5+
テキストをコントロールするのに中括弧を使えるのと同じように、要素の属性をコントロールするのに中括弧を使うことができます。
66

7-
Our image is missing a `src` — let's add one:
7+
画像 (image) に `src` がありません。これを追加してみましょう。
88

99
```svelte
1010
<img +++src={src}+++ />
1111
```
1212

13-
That's better. But Svelte is giving us a warning:
13+
これでよくなりました。ただし、まだ警告が表示され続けています。
1414

1515
> A11y: &lt;img&gt; element should have an alt attribute
1616
17-
When building web apps, it's important to make sure that they're _accessible_ to the broadest possible userbase, including people with (for example) impaired vision or motion, or people without powerful hardware or good internet connections. Accessibility (shortened to a11y) isn't always easy to get right, but Svelte will help by warning you if you write inaccessible markup.
17+
Webアプリケーションは、例えば視覚や動作に障害のある方や、高スペックな端末や高速なインターネット回線を持っていない方など、可能な限り幅広いユーザーにとって*使いやすいものである*ことが重要です。アクセシビリティ(Accessibility、略:a11y)を正しく行うことは簡単ではありませんが、Svelteは警告を表示してa11yを正しく行う手助けをしてくれます。
1818

19-
In this case, we're missing the `alt` attribute that describes the image for people using screenreaders, or people with slow or flaky internet connections that can't download the image. Let's add one:
19+
この場合、スクリーンリーダー(画面読み上げソフト)を使用するユーザーやインターネット回線が低速・不安定で画像をダウンロードできないユーザーに必要な`alt`という画像を説明する属性が足りていません。追加しましょう。
2020

2121
```svelte
2222
<img src={src} +++alt="A man dances."+++ />
2323
```
2424

25-
We can use curly braces _inside_ attributes. Try changing it to `"{name} dances."` — remember to declare a `name` variable in the `<script>` block.
25+
要素の**でも中括弧を使用することができます。`<script>`ブロックの中に`name`変数を宣言し、`A man dances.``"{name} dances."`に変更してみましょう。
2626

2727
## Shorthand attributes
2828

29-
It's not uncommon to have an attribute where the name and value are the same, like `src={src}`. Svelte gives us a convenient shorthand for these cases:
29+
`src={src}`のように、属性の名前と値の変数が一致することは珍しくありません。このような場合、Svelteでは省略して書くことができます。
3030

3131
```svelte
3232
<img +++{src}+++ alt="A man dances." />

content/tutorial/01-svelte/01-introduction/04-styling/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Styling
33
---
44

5-
HTMLと同じように、コンポーネントには `<style>` タグを置くことができます。`<p>` 要素にいくつかスタイルを追加してみましょう。
5+
HTMLと同じように、コンポーネントには`<style>`タグを置くことができます。`<p>`要素にいくつかスタイルを追加してみましょう。
66

77
```svelte
88
<p>This is a paragraph.</p>
@@ -16,4 +16,4 @@ HTMLと同じように、コンポーネントには `<style>` タグを置く
1616
</style>
1717
```
1818

19-
重要なのは、これらのスタイルが _このコンポーネントにのみ適用されるということです_ 。次のステップで説明しますが、別の箇所の `<p>` 要素のスタイルに影響を与えてしまうようなことはありません。
19+
重要なのは、これらのスタイルが*このコンポーネントにのみ適用されるということです*。次のステップで説明しますが、別の箇所の`<p>`要素のスタイルに影響を与えてしまうようなことはありません。

content/tutorial/01-svelte/01-introduction/05-nested-components/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
title: Nested components
33
---
44

5-
It would be impractical to put your entire app in a single component. Instead, we can import components from other files and include them in our markup.
5+
アプリ全体を単一のコンポーネントにまとめるのは現実的ではありません。代わりに、他のファイルからコンポーネントをインポートし、マークアップでそれを使用することができます。
66

7-
Add a `<script>` tag that imports `Nested.svelte`...
7+
`<script>` タグを追加して `Nested.svelte` をインポートしましょう…
88

99
```svelte
1010
+++<script>
1111
import Nested from './Nested.svelte';
1212
</script>+++
1313
```
1414

15-
...and include a `<Nested />` component:
15+
…そして `<Nested />` コンポーネントを使用します。
1616

1717
```svelte
1818
<p>This is a paragraph.</p>
1919
+++<Nested />+++
2020
```
2121

22-
Notice that even though `Nested.svelte` has a `<p>` element, the styles from `App.svelte` don't leak in.
22+
`Nested.svelte` には `<p>` 要素がありますが、`App.svelte` のスタイルが適用されていないことに注目してください。
2323

24-
> Component names are always capitalised, to distinguish them from HTML elements.
24+
> HTML 要素と区別するため、コンポーネントの名前は常に大文字で始まっています

content/tutorial/01-svelte/01-introduction/06-html-tags/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: HTML tags
33
---
44

5-
Ordinarily, strings are inserted as plain text, meaning that characters like `<` and `>` have no special meaning.
5+
通常、文字列はプレーンテキストとして挿入され、`<``>`のような文字は特別な意味を持ちません。
66

7-
But sometimes you need to render HTML directly into a component. For example, the words you're reading right now exist in a markdown file that gets included on this page as a blob of HTML.
7+
しかし、HTMLをコンポーネントに直接レンダリングする必要がある場合もあります。例えば、あなたが今読んでいる文章はマークダウンファイルに存在し、HTMLのblobとしてこのページに含まれています。
88

9-
In Svelte, you do this with the special `{@html ...}` tag:
9+
Svelteでは、`{@html ...}` という特別なタグを使ってこれを行います。
1010

1111
```svelte
1212
<p>{+++@html+++ string}</p>
1313
```
1414

15-
> Svelte doesn't perform any sanitization of the expression inside `{@html ...}` before it gets inserted into the DOM. In other words, if you use this feature it's critical that you manually escape HTML that comes from sources you don't trust, otherwise you risk exposing your users to XSS attacks.
15+
> Svelte は DOM に挿入される前に `{@html ...}` 内の式のサニタイズを行いません。違う言い方をすれば、この機能を使用する場合は信頼できないソースから来た HTML を手動でエスケープすることが重要です、そうしなければユーザーをXSS攻撃にさらす危険性があります。

0 commit comments

Comments
 (0)