From 18da3bc1367e330027a395a58c286dd827838abf Mon Sep 17 00:00:00 2001 From: tomoam <29677552+tomoam@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:45:29 +0900 Subject: [PATCH] translate 04-svelte-js-files.md and 01-what-are-runes.md --- .../01-introduction/04-svelte-js-files.md | 8 ++++---- .../docs/svelte/02-runes/01-what-are-runes.md | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/svelte.dev/content/docs/svelte/01-introduction/04-svelte-js-files.md b/apps/svelte.dev/content/docs/svelte/01-introduction/04-svelte-js-files.md index d34bcc8528..dd614d1275 100644 --- a/apps/svelte.dev/content/docs/svelte/01-introduction/04-svelte-js-files.md +++ b/apps/svelte.dev/content/docs/svelte/01-introduction/04-svelte-js-files.md @@ -1,11 +1,11 @@ --- NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts -title: .svelte.js and .svelte.ts files +title: .svelte.js と .svelte.ts ファイル --- -Besides `.svelte` files, Svelte also operates on `.svelte.js` and `.svelte.ts` files. +Svelte では、`.svelte` ファイル以外に、`.svelte.js` ファイルと `.svelte.ts` ファイルも処理します。 -These behave like any other `.js` or `.ts` module, except that you can use runes. This is useful for creating reusable reactive logic, or sharing reactive state across your app. +これらは他の `.js` や `.ts` モジュールと同じように振る舞いますが、Rune を使用することができます。これは、再利用可能なりアクティブロジックを作ったり、アプリ全体でリアクティブな state を共有するのに有用です。 > [!LEGACY] -> This is a concept that didn't exist prior to Svelte 5 +> これは Svelte 5 より前には存在しないコンセプトです diff --git a/apps/svelte.dev/content/docs/svelte/02-runes/01-what-are-runes.md b/apps/svelte.dev/content/docs/svelte/02-runes/01-what-are-runes.md index 2bae4b3561..c10aaf3d07 100644 --- a/apps/svelte.dev/content/docs/svelte/02-runes/01-what-are-runes.md +++ b/apps/svelte.dev/content/docs/svelte/02-runes/01-what-are-runes.md @@ -1,25 +1,25 @@ --- NOTE: do not edit this file, it is generated in apps/svelte.dev/scripts/sync-docs/index.ts -title: What are runes? +title: Runeとは? --- > [!NOTE] **rune** /ro͞on/ _noun_ > -> A letter or mark used as a mystical or magic symbol. +> 神秘的または魔術的なシンボルとして使用される文字やマーク。 -Runes are symbols that you use in `.svelte` and `.svelte.js`/`.svelte.ts` files to control the Svelte compiler. If you think of Svelte as a language, runes are part of the syntax — they are _keywords_. +Rune は `.svelte` ファイルや `.svelte.js`/`.svelte.ts` ファイルで使用するシンボルで、Svelte コンパイラをコントロールします。Svelte を言語として考えるなら、Rune は構文の一部であり、キーワードです。 -Runes have a `$` prefix and look like functions: +Rune には `$` 接頭辞があり、関数のように見えます: ```js let message = $state('hello'); ``` -They differ from normal JavaScript functions in important ways, however: +しかし、これらは通常の JavaScript の関数とはいくつか重要な点で異なります: -- You don't need to import them — they are part of the language -- They're not values — you can't assign them to a variable or pass them as arguments to a function -- Just like JavaScript keywords, they are only valid in certain positions (the compiler will help you if you put them in the wrong place) +- インポートする必要はありません — これは言語の一部です +- 値ではありません — 変数に代入したり、関数の引数として渡すことはできません +- JavaScript のキーワードと同じように、特定の位置でのみ有効です (もし間違った位置に置いても、コンパイラが助けてくれます) > [!LEGACY] -> Runes didn't exist prior to Svelte 5. +> Rune は Svelte 5 以前には存在しません。