Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions crates/typst-library/src/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ pub fn module() -> Module {
Module::new("html", html)
}

/// An HTML element that can contain Typst content.
/// Typstのコンテンツを含むことができるHTML要素。
///
/// Typst's HTML export automatically generates the appropriate tags for most
/// elements. However, sometimes, it is desirable to retain more control. For
/// example, when using Typst to generate your blog, you could use this function
/// to wrap each article in an `<article>` tag.
/// TypstのHTMLエクスポートは、ほとんどの要素に対して適切なタグを自動的に生成します。
/// ただし、場合によっては、より強いコントロールを手元に残しておくことが望ましい場合があります。
Copy link
Preview

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The translation feels somewhat awkward. Consider a more natural Japanese expression like 「ただし、場合によってはより詳細な制御が必要になることがあります。」 or 「しかし、時にはより細かい制御を行いたい場合があります。」

Suggested change
/// ただし、場合によっては、より強いコントロールを手元に残しておくことが望ましい場合があります
/// ただし、場合によってはより詳細な制御が必要になることがあります

Copilot uses AI. Check for mistakes.

Copy link
Member

@kimushun1101 kimushun1101 Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よりシンプルに以下のような訳はいかがでしょうか?

/// ただし、場合によっては、よりより細かく制御したい場合があります。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpickですがsuggestionの「より」が重複しています。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

場合によっては、より細かく制御したい場合があります。と「場合」という文字も被っており、次の文も例えば、Typstを使ってブログを生成する場合、と続くため、よりシンプルにしてみました。

Suggested change
/// ただし、場合によっては、より強いコントロールを手元に残しておくことが望ましい場合があります
/// ただし、より細かく制御したい場合もあります

/// 例えば、Typstを使ってブログを生成する場合、
/// それぞれの記事を`<article>`タグでラップするためにこの関数を使用できます。
///
/// Typst is aware of what is valid HTML. A tag and its attributes must form
/// syntactically valid HTML. Some tags, like `meta` do not accept content.
/// Hence, you must not provide a body for them. We may add more checks in the
/// future, so be sure that you are generating valid HTML when using this
/// function.
/// Typstは有効なHTMLが何であるかを認識しています。
/// タグとその属性は、構文的に有効なHTMLを構成していなければなりません。
/// `meta`のようないくつかのタグはコンテンツを受け付けません。
/// したがって、それらに対して本文を提供してはいけません。
/// 将来的に、この機能に対して更に多くのチェックを追加する可能性があるため、この関数を使用する際は有効なHTMLを生成していることを確認してください。
Copy link
Preview

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The phrase 「この機能に対して」 is redundant. Consider simplifying to 「将来的により多くのチェックを追加する可能性があるため」 for better readability.

Suggested change
/// 将来的に、この機能に対して更に多くのチェックを追加する可能性があるため、この関数を使用する際は有効なHTMLを生成していることを確認してください。
/// 将来的により多くのチェックを追加する可能性があるため、この関数を使用する際は有効なHTMLを生成していることを確認してください。

Copilot uses AI. Check for mistakes.

///
/// Normally, Typst will generate `html`, `head`, and `body` tags for you. If
/// you instead create them with this function, Typst will omit its own tags.
/// 通常、Typstは`html``head`、および`body`タグを生成します。
/// 代わりにこの関数でそれらを作成した場合、Typstは自身の生成するタグを省略します。
///
/// ```typ
/// #html.elem("div", attrs: (style: "background: aqua"))[
Expand All @@ -40,17 +40,17 @@ pub fn module() -> Module {
/// ```
#[elem(name = "elem")]
pub struct HtmlElem {
/// The element's tag.
/// 要素のタグ。
#[required]
pub tag: HtmlTag,

/// The element's HTML attributes.
/// 要素のHTML属性。
#[borrowed]
pub attrs: HtmlAttrs,

/// The contents of the HTML element.
/// HTML要素の内容。
///
/// The body can be arbitrary Typst content.
/// 本文には任意のTypstコンテンツを指定できます。
#[positional]
#[borrowed]
pub body: Option<Content>,
Expand All @@ -64,19 +64,19 @@ impl HtmlElem {
}
}

/// An element that lays out its content as an inline SVG.
/// コンテンツをインラインSVGとしてレイアウトする要素。
///
/// Sometimes, converting Typst content to HTML is not desirable. This can be
/// the case for plots and other content that relies on positioning and styling
/// to convey its message.
/// TypstのコンテンツをHTMLに変換することが望ましくない場合があります。
/// これは、
/// メッセージの伝達が位置決めやスタイル指定に依存するプロットおよびその他のコンテンツに当てはまります。
Comment on lines +69 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Sometimesの感じを出すために「望ましくない場合があります。」の代わりに「望ましくない場合もあります。」とするというのはどうでしょう?
  • plotscontent that relies on positioning and styling to convey its messageの一部かと思います。以下のような訳ではいかがでしょうか?
  • plots自体をどう訳すかも考えましたが、公式ドキュメントを「plot」で検索したところ、「drawings and plots」と表現されていることが多く、グラフプロットのことを指しているのかなと思いました。
Suggested change
/// TypstのコンテンツをHTMLに変換することが望ましくない場合があります。
/// これは、
/// メッセージの伝達が位置決めやスタイル指定に依存するプロットおよびその他のコンテンツに当てはまります。
/// TypstのコンテンツをHTMLに変換することが望ましくない場合もあります。
/// たとえば、グラフプロットなど、位置決めやスタイルに依存して意味を伝えるコンテンツがそれに当たります。

///
/// This function allows you to use the Typst layout engine that would also be
/// used for PDF, SVG, and PNG export to render a part of your document exactly
/// how it would appear when exported in one of these formats. It embeds the
/// content as an inline SVG.
/// この関数を使用すると、
/// PDFSVG、およびPNGエクスポートにも使用されるTypstレイアウトエンジンを使用して、
/// 文書の一部を、これらの形式のいずれかでエクスポートした場合に表示されるのとまったく同じようにレンダリングできます。
/// この関数はコンテンツをインラインSVGとして埋め込みます。
#[elem]
pub struct FrameElem {
/// The content that shall be laid out.
///レイアウト対象のコンテンツ。
#[positional]
#[required]
pub body: Content,
Expand Down
4 changes: 2 additions & 2 deletions website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
"/docs/reference/pdf/": "translated",
"/docs/reference/pdf/embed/": "untranslated",
"/docs/reference/html/": "untranslated",
"/docs/reference/html/elem/": "untranslated",
"/docs/reference/html/frame/": "untranslated",
"/docs/reference/html/elem/": "translated",
"/docs/reference/html/frame/": "translated",
"/docs/reference/png/": "untranslated",
"/docs/reference/svg/": "untranslated",
"/docs/guides/": "translated",
Expand Down