Skip to content

Commit 7550dfa

Browse files
ultimatileCopilotkimushun1101
authored
/docs/reference/text/rawの翻訳 (#274)
Co-authored-by: Copilot <[email protected]> Co-authored-by: Shunsuke KIMURA <[email protected]>
1 parent 9a29e7c commit 7550dfa

File tree

2 files changed

+53
-74
lines changed

2 files changed

+53
-74
lines changed

crates/typst-library/src/text/raw.rs

Lines changed: 52 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ use crate::text::{FontFamily, FontList, LinebreakElem, LocalName, TextElem, Text
2525
use crate::visualize::Color;
2626
use crate::World;
2727

28-
/// Raw text with optional syntax highlighting.
28+
/// オプションでシンタックスハイライトを持つ生テキスト。
2929
///
30-
/// Displays the text verbatim and in a monospace font. This is typically used
31-
/// to embed computer code into your document.
30+
/// テキストをそのまま等幅フォントで表示します。
31+
/// これは通常、計算機のコードをドキュメント内に埋め込むために使います。
3232
///
33-
/// # Example
33+
/// #
3434
/// ````example
3535
/// Adding `rbx` to `rcx` gives
3636
/// the desired result.
@@ -50,28 +50,23 @@ use crate::World;
5050
/// also trimmed.
5151
/// ````
5252
///
53-
/// You can also construct a [`raw`] element programmatically from a string (and
54-
/// provide the language tag via the optional [`lang`]($raw.lang) argument).
53+
/// また、プログラミング的に文字列から[`raw`]要素を作成できます(オプションの[`lang`]($raw.lang)引数を用いて言語タグを提供できます)。
5554
/// ```example
5655
/// #raw("fn " + "main() {}", lang: "rust")
5756
/// ```
5857
///
59-
/// # Syntax
60-
/// This function also has dedicated syntax. You can enclose text in 1 or 3+
61-
/// backticks (`` ` ``) to make it raw. Two backticks produce empty raw text.
62-
/// This works both in markup and code.
58+
/// # 構文
59+
/// この関数には専用の構文もあります。
60+
/// テキストを1つまたは3つ以上のバッククォート(`` ` ``)で囲むと生テキストにできます。
61+
/// 2つのバッククォートは空の生テキストを作成します。
62+
/// これはマークアップ中でもコード中でも動作します。
6363
///
64-
/// When you use three or more backticks, you can additionally specify a
65-
/// language tag for syntax highlighting directly after the opening backticks.
66-
/// Within raw blocks, everything (except for the language tag, if applicable)
67-
/// is rendered as is, in particular, there are no escape sequences.
64+
/// 3つ以上のバッククォートを使用する場合、シンタックスハイライトのために開きバッククォートの直後に言語タグを追加で指定することができます。
65+
/// rawブロック内部では、(もし言語タグが利用可能なら、それ以外の)全てがそのままレンダリングされます。特に、エスケープシーケンスはありません。
6866
///
69-
/// The language tag is an identifier that directly follows the opening
70-
/// backticks only if there are three or more backticks. If your text starts
71-
/// with something that looks like an identifier, but no syntax highlighting is
72-
/// needed, start the text with a single space (which will be trimmed) or use
73-
/// the single backtick syntax. If your text should start or end with a
74-
/// backtick, put a space before or after it (it will be trimmed).
67+
/// 言語タグは、3つ以上のバッククォートがある場合にのみ使用できる、開きバッククォートの直後に付ける識別子です。
68+
/// 識別子のようなものからテキストが始まるものの、シンタックスハイライトが不要な場合、単一の空白(トリムされます)からテキストを始めるか、単一のバッククォート構文を使用してください。
69+
/// バッククォートでテキストが始まるか終わるかしなければならない場合は、その前か後に空白を置いてください(トリムされます)。
7570
#[elem(
7671
scope,
7772
title = "Raw Text / Code",
@@ -83,10 +78,9 @@ use crate::World;
8378
PlainText
8479
)]
8580
pub struct RawElem {
86-
/// The raw text.
81+
/// 生テキスト。
8782
///
88-
/// You can also use raw blocks creatively to create custom syntaxes for
89-
/// your automations.
83+
/// 自動化のために、rawブロックを使ってカスタム構文をクリエイティブに作成することもできます。
9084
///
9185
/// ````example
9286
/// // Parse numbers in raw blocks with the
@@ -106,11 +100,10 @@ pub struct RawElem {
106100
#[required]
107101
pub text: RawContent,
108102

109-
/// Whether the raw text is displayed as a separate block.
103+
/// 生テキストを独立したブロックとして表示するかどうか。
110104
///
111-
/// In markup mode, using one-backtick notation makes this `{false}`.
112-
/// Using three-backtick notation makes it `{true}` if the enclosed content
113-
/// contains at least one line break.
105+
/// マークアップモードでは、バッククォート1つを使うとこれは`{false}`になります。
106+
/// バッククォート3つ使うと、囲まれたコンテンツが1つ以上の改行を含む場合は`{true}`になります。
114107
///
115108
/// ````example
116109
/// // Display inline code in a small box
@@ -141,13 +134,9 @@ pub struct RawElem {
141134
#[default(false)]
142135
pub block: bool,
143136

144-
/// The language to syntax-highlight in.
137+
/// シンタックスハイライトを行う言語。
145138
///
146-
/// Apart from typical language tags known from Markdown, this supports the
147-
/// `{"typ"}`, `{"typc"}`, and `{"typm"}` tags for
148-
/// [Typst markup]($reference/syntax/#markup),
149-
/// [Typst code]($reference/syntax/#code), and
150-
/// [Typst math]($reference/syntax/#math), respectively.
139+
/// Markdownで用いられている一般的な言語以外では、[Typst markup]($reference/syntax/#markup)の`{"typ"}`、[Typst code]($reference/syntax/#code)の`{"typc"}`、[Typst math]($reference/syntax/#math)の`{"typm"}`のタグがそれぞれサポートされています。
151140
///
152141
/// ````example
153142
/// ```typ
@@ -159,15 +148,10 @@ pub struct RawElem {
159148
#[borrowed]
160149
pub lang: Option<EcoString>,
161150

162-
/// The horizontal alignment that each line in a raw block should have.
163-
/// This option is ignored if this is not a raw block (if specified
164-
/// `block: false` or single backticks were used in markup mode).
151+
/// rawブロック中の各行が持つべき水平方向の配置。
152+
/// このオプションはrawブロックではない(`block: false`が指定されるか、マークアップモードで1つのバッククォートが使用された)場合は無視されます。
165153
///
166-
/// By default, this is set to `{start}`, meaning that raw text is
167-
/// aligned towards the start of the text direction inside the block
168-
/// by default, regardless of the current context's alignment (allowing
169-
/// you to center the raw block itself without centering the text inside
170-
/// it, for example).
154+
/// これはデフォルトでは`{start}`で、現在のコンテキストの配置によらず、生テキストがブロック内部の書き始めの位置揃えになることを意味します(例えば、内部テキストを中央揃えにせずにrawブロックを中央揃えにできます)。
171155
///
172156
/// ````example
173157
/// #set raw(align: center)
@@ -180,15 +164,15 @@ pub struct RawElem {
180164
#[default(HAlignment::Start)]
181165
pub align: HAlignment,
182166

183-
/// Additional syntax definitions to load. The syntax definitions should be
184-
/// in the [`sublime-syntax` file format](https://www.sublimetext.com/docs/syntax.html).
167+
/// 追加で読み込む構文定義。
168+
/// 構文定義は[`sublime-syntax`ファイル形式](https://www.sublimetext.com/docs/syntax.html)でなければなりません。
185169
///
186-
/// You can pass any of the following values:
170+
/// 以下の値のいずれかを渡すことができます。
187171
///
188-
/// - A path string to load a syntax file from the given path. For more
189-
/// details about paths, see the [Paths section]($syntax/#paths).
190-
/// - Raw bytes from which the syntax should be decoded.
191-
/// - An array where each item is one the above.
172+
/// - 与えられたパスから構文ファイルを読み込みためのパス文字列。
173+
/// パスに関する詳細は[パスのセクション]($syntax/#paths)を参照してください。
174+
/// - 構文をデコードするための生バイト列。
175+
/// - 各アイテムが上記のいずれかである配列。
192176
///
193177
/// ````example
194178
/// #set raw(syntaxes: "SExpressions.sublime-syntax")
@@ -208,23 +192,20 @@ pub struct RawElem {
208192
#[fold]
209193
pub syntaxes: Derived<OneOrMultiple<DataSource>, Vec<RawSyntax>>,
210194

211-
/// The theme to use for syntax highlighting. Themes should be in the
212-
/// [`tmTheme` file format](https://www.sublimetext.com/docs/color_schemes_tmtheme.html).
195+
/// シンタックスハイライトに用いるテーマ。
196+
/// テーマは[`tmTheme`ファイル形式](https://www.sublimetext.com/docs/color_schemes_tmtheme.html)でなければなりません。
213197
///
214-
/// You can pass any of the following values:
198+
/// 以下の値のいずれかを渡すことができます。
215199
///
216-
/// - `{none}`: Disables syntax highlighting.
217-
/// - `{auto}`: Highlights with Typst's default theme.
218-
/// - A path string to load a theme file from the given path. For more
219-
/// details about paths, see the [Paths section]($syntax/#paths).
220-
/// - Raw bytes from which the theme should be decoded.
200+
/// - `{none}`: シンタックスハイライトを無効化します。
201+
/// - `{auto}`: Typstのデフォルトテーマでハイライトします。
202+
/// - 与えられたパスからテーマファイルを読み込みためのパス文字列。
203+
/// パスに関する詳細は[パスのセクション]($syntax/#paths)を参照してください。
204+
/// - テーマをデコードするための生バイト列。
221205
///
222-
/// Applying a theme only affects the color of specifically highlighted
223-
/// text. It does not consider the theme's foreground and background
224-
/// properties, so that you retain control over the color of raw text. You
225-
/// can apply the foreground color yourself with the [`text`] function and
226-
/// the background with a [filled block]($block.fill). You could also use
227-
/// the [`xml`] function to extract these properties from the theme.
206+
/// テーマの適用はハイライトされたテキストの色にのみ影響を与えます。テーマの前景および背景プロパティは無視され、生テキストの色の制御は残ります。
207+
/// [`text`]関数を用いて前景色を、[ブロックの塗り潰し]($block.fill)を用いて背景色を、それぞれ手動で設定できます。
208+
/// [`xml`]関数でもこれらのプロパティをテーマから抽出できます。
228209
///
229210
/// ````example
230211
/// #set raw(theme: "halcyon.tmTheme")
@@ -251,8 +232,8 @@ pub struct RawElem {
251232
#[borrowed]
252233
pub theme: Smart<Option<Derived<DataSource, RawTheme>>>,
253234

254-
/// The size for a tab stop in spaces. A tab is replaced with enough spaces to
255-
/// align with the next multiple of the size.
235+
/// スペースで測ったタブ幅。
236+
/// タブは、次のタブ幅の整数倍位置までのスペースで置き換えられます。
256237
///
257238
/// ````example
258239
/// #set raw(tab-size: 8)
@@ -612,28 +593,26 @@ impl RawTheme {
612593
}
613594
}
614595

615-
/// A highlighted line of raw text.
596+
/// ハイライトされた生テキストの行。
616597
///
617-
/// This is a helper element that is synthesized by [`raw`] elements.
598+
/// これは[`raw`]要素によって合成される補助要素です。
618599
///
619-
/// It allows you to access various properties of the line, such as the line
620-
/// number, the raw non-highlighted text, the highlighted text, and whether it
621-
/// is the first or last line of the raw block.
600+
/// 行番号、ハイライトされていない生テキスト、ハイライトされたテキスト、rawブロックの最初の行や最後の行であるかどうかなどの、行のさまざまなプロパティにアクセスすることができます。
622601
#[elem(name = "line", title = "Raw Text / Code Line", Show, PlainText)]
623602
pub struct RawLine {
624-
/// The line number of the raw line inside of the raw block, starts at 1.
603+
/// 1始まりのrawブロック内の行番号。
625604
#[required]
626605
pub number: i64,
627606

628-
/// The total number of lines in the raw block.
607+
/// rawブロック内にある総行数。
629608
#[required]
630609
pub count: i64,
631610

632-
/// The line of raw text.
611+
/// 生テキストの行。
633612
#[required]
634613
pub text: EcoString,
635614

636-
/// The highlighted raw text.
615+
/// ハイライトされた生テキスト。
637616
#[required]
638617
pub body: Content,
639618
}

website/translation-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"/docs/reference/text/lorem/": "translated",
6969
"/docs/reference/text/lower/": "translated",
7070
"/docs/reference/text/overline/": "translated",
71-
"/docs/reference/text/raw/": "untranslated",
71+
"/docs/reference/text/raw/": "translated",
7272
"/docs/reference/text/smallcaps/": "translated",
7373
"/docs/reference/text/smartquote/": "untranslated",
7474
"/docs/reference/text/strike/": "translated",

0 commit comments

Comments
 (0)