Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
34 changes: 14 additions & 20 deletions crates/typst-library/src/foundations/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ use crate::foundations::{
elem, func, scope, ty,
};

/// A Unicode symbol.
/// Unicode記号。
///
/// Typst defines common symbols so that they can easily be written with
/// standard keyboards. The symbols are defined in modules, from which they can
/// be accessed using [field access notation]($scripting/#fields):
/// Typstは、標準のキーボードで簡単に入力できるよう、よく使われる記号を定義しています。
/// 記号はモジュール内に定義されており、[フィールドアクセス構文]($scripting/#fields)でアクセスできます。
///
/// - General symbols are defined in the [`sym` module]($category/symbols/sym)
/// and are accessible without the `sym.` prefix in math mode.
/// - Emoji are defined in the [`emoji` module]($category/symbols/emoji)
/// - 一般的な記号は[`sym`モジュール]($category/symbols/sym)に定義されており、数式モードでは`sym.`接頭辞なしでアクセスできます。
/// - 絵文字は[`emoji`モジュール]($category/symbols/emoji)に定義されています。
///
/// Moreover, you can define custom symbols with this type's constructor
/// function.
/// さらに、この型のコンストラクター関数を用いてカスタム記号を定義できます。
///
/// ```example
/// #sym.arrow.r \
Expand All @@ -36,10 +33,9 @@ use crate::foundations::{
/// #emoji.face.halo
/// ```
///
/// Many symbols have different variants, which can be selected by appending the
/// modifiers with dot notation. The order of the modifiers is not relevant.
/// Visit the documentation pages of the symbol modules and click on a symbol to
/// see its available variants.
/// 多くの記号には異なるバリアントがあり、ドット記法で修飾子を付加することで選択できます。
/// 修飾子の順序は問いません。
/// 記号モジュールのドキュメントページにアクセスし、記号をクリックすると、利用可能なバリアントを確認できます。
Comment on lines +36 to +38
///
/// ```example
/// $arrow.l$ \
Expand Down Expand Up @@ -218,7 +214,7 @@ impl Symbol {

#[scope]
impl Symbol {
/// Create a custom symbol with modifiers.
/// 修飾子付きのカスタム記号を生成します。
///
/// ```example
/// #let envelope = symbol(
Expand All @@ -238,13 +234,11 @@ impl Symbol {
#[func(constructor)]
pub fn construct(
span: Span,
/// The variants of the symbol.
/// 記号のバリアント。
///
/// Can be a just a string consisting of a single character for the
/// modifierless variant or an array with two strings specifying the modifiers
/// and the symbol. Individual modifiers should be separated by dots. When
/// displaying a symbol, Typst selects the first from the variants that have
/// all attached modifiers and the minimum number of other modifiers.
/// 修飾子のないバリアントの場合は単一の文字からなる文字列、それ以外の場合は修飾子と記号を指定する2つの文字列の配列を指定できます。
/// 各修飾子はドットで区切ります。
/// 記号を表示する際、Typstは付加された全ての修飾子を含み、それ以外の修飾子の数が最小であるバリアントの中から最初のものを選択します。
#[variadic]
variants: Vec<Spanned<SymbolVariant>>,
) -> SourceResult<Symbol> {
Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"/docs/reference/foundations/selector/": "untranslated",
"/docs/reference/foundations/std/": "untranslated",
"/docs/reference/foundations/str/": "untranslated",
"/docs/reference/foundations/symbol/": "untranslated",
"/docs/reference/foundations/symbol/": "translated",
"/docs/reference/foundations/sys/": "untranslated",
"/docs/reference/foundations/target/": "untranslated",
"/docs/reference/foundations/type/": "untranslated",
Expand Down
Loading