Skip to content

Conversation

sbtseiji
Copy link

@sbtseiji sbtseiji commented Sep 3, 2025

Calculationを翻訳しました。

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR translates the calc module documentation and comments from English to Japanese.

  • Translates all function documentation comments and parameter descriptions
  • Updates module comments for mathematical functions
  • Updates translation status to mark calc module as translated

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
website/translation-status.json Updates calc module status from "untranslated" to "translated"
crates/typst-library/src/foundations/calc.rs Translates all documentation comments and parameter descriptions for mathematical functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ultimatile
Copy link
Contributor

calcの最初の説明文とbinomkが未翻訳です。

@sbtseiji
Copy link
Author

sbtseiji commented Sep 9, 2025

ありがとうございます。最初の説明文は別のファイルになっていたのですね。そちらの訳、および訳漏れ箇所の翻訳を追加しました。

@ultimatile
Copy link
Contributor

対応ありがとうございます。

私はnon-negativeは非負と訳すことに馴染みがあるのですが、みなさんはどうですかね?

@ultimatile
Copy link
Contributor

あと、ソース中のコメントにあるものの中でドキュメントに表示されるコメントと、そうでないものがあります。大雑把にはpublicになっている関数が表示されるのですが、publicであったとしてもドキュメントに表示されない、あるいは別の場所に表示されるものがありますので、mise run generate && mise run previewで翻訳が行った部分と表示の変化がどう対応するのかは逐次確認しながら作業することをお勧めします。

}

/// Calculates the absolute value of a numeric value.
/// 数値の絶対値。
Copy link
Contributor

Choose a reason for hiding this comment

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

直訳としては正しいのですが、日本語として違和感があるので、単に「絶対値。」か「絶対値の計算。」で良いと思います。

Copy link
Contributor

Choose a reason for hiding this comment

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

「ある数値の」を入れても良いと思います。

}

/// Raises a value to some exponent.
/// 数値のべき乗。
Copy link
Contributor

Choose a reason for hiding this comment

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

こちらも「べき乗。」で良いと思います。

}

/// Calculates the square root of a number.
/// 値の平方根。
Copy link
Contributor

Choose a reason for hiding this comment

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

「平方根。」もしくは「平方根の計算。」

}

/// Calculates the real nth root of a number.
/// 数値のn乗根。
Copy link
Contributor

Choose a reason for hiding this comment

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

「n乗根。」もしくは「n乗根を計算します。」

#[func]
pub fn root(
/// The expression to take the root of
/// 根号で表現される式
Copy link
Contributor

@ultimatile ultimatile Sep 9, 2025

Choose a reason for hiding this comment

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

https://typst-jp.github.io/docs/reference/math/roots/ と翻訳を合わせた方が統一感が出ます。

Suggested change
/// 根号で表現される式
/// 根を取る対象の式。

/// 根号で表現される式
radicand: f64,
/// Which root of the radicand to take
/// 根号の指数
Copy link
Contributor

@ultimatile ultimatile Sep 9, 2025

Choose a reason for hiding this comment

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

同上です。

Suggested change
/// 根号の指数
/// 被開方数の何乗根を取るか。

}

/// Calculates the sine of an angle.
/// 角度のサイン(正弦)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「サイン(正弦)の計算。」または「ある角度のサイン(正弦)を計算。」でしょうか

}

/// Calculates the cosine of an angle.
/// 角度のコサイン(余弦)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「コサイン(余弦)の計算。」または「ある角度のコサイン(余弦)を計算。」でしょうか

}

/// Calculates the tangent of an angle.
/// 角度のタンジェント(正接)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「タンジェント(正接)の計算。」または「ある角度のタンジェント(正接)を計算。」でしょうか

///
/// When called with an integer or a float, they will be interpreted as
/// radians.
/// 整数または浮動小数点数で呼び出された場合、それらはラジアンとして解釈されます。
Copy link
Contributor

Choose a reason for hiding this comment

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

こちらの方が自然な気がします。

Suggested change
/// 整数または浮動小数点数で呼び出された場合、それらはラジアンとして解釈されます。
/// 整数または浮動小数点数に対して呼び出された場合、それらはラジアンとして解釈されます。

}

/// Calculates the arcsine of a number.
/// 数値のアークサイン(逆正弦)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「アークサイン(逆正弦)の計算。」または「ある数値のアークサイン(逆正弦)を計算。」でしょうか

}

/// Calculates the arccosine of a number.
/// 数値のアークコサイン(逆余弦)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「アークコサイン(逆余弦)の計算。」または「ある数値のアークコサイン(逆余弦)を計算。」でしょうか

}

/// Calculates the arctangent of a number.
/// 数値のアークタンジェント(逆正接)。
Copy link
Contributor

Choose a reason for hiding this comment

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

「アークタンジェント(逆正接)の計算。」または「ある数値のアークタンジェント(逆正接)を計算。」でしょうか

}

/// Calculates the four-quadrant arctangent of a coordinate.
/// 座標の四象限アークタンジェント。
Copy link
Contributor

Choose a reason for hiding this comment

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

「四象限アークタンジェントの計算。」または「ある座標の四象限アークタンジェントを計算。」でしょうか

#[func(title = "Four-quadrant Arctangent")]
pub fn atan2(
/// The X coordinate.
/// X座標
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// X座標
/// X座標

/// X座標
x: Num,
/// The Y coordinate.
/// Y座標
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Y座標
/// Y座標

}

/// Calculates the hyperbolic sine of a hyperbolic angle.
/// 双曲線角の双曲線サイン。
Copy link
Contributor

Choose a reason for hiding this comment

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

「双曲線サイン」という言い方はあまりしないと思います。併記するなら「ハイパーボリックサイン(双曲線正弦)。」だと思います。また双曲角と言うのが一般的なようです。

したがって、「ハイパーボリックサイン(双曲線正弦)を計算。」あるいは「ある双曲角のハイパーボリックサイン(双曲線正弦)を計算。」などでしょうか。

#[func(title = "Hyperbolic Sine")]
pub fn sinh(
/// The hyperbolic angle whose hyperbolic sine to calculate.
/// 双曲線サインを計算する双曲線角。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 双曲線サインを計算する双曲線角
/// ハイパーボリックサインを計算する双曲角

/// error if the resulting [`float`] or [`decimal`] is larger than the maximum
/// 64-bit signed integer or smaller than the minimum for that type.
/// この関数はつねに[整数値]($int)を返し、結果となる[`float`]や
/// [`decimal`]が64ビット符号つき整数の最大値より大きい、
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// [`decimal`]が64ビット符号つき整数の最大値より大きい
/// [`decimal`]が64ビット符号付き整数の最大値より大きい

/// 64-bit signed integer or smaller than the minimum for that type.
/// この関数はつねに[整数値]($int)を返し、結果となる[`float`]や
/// [`decimal`]が64ビット符号つき整数の最大値より大きい、
/// または最小値より小さい場合はエラーとなります。
Copy link
Contributor

Choose a reason for hiding this comment

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

"Note that"を訳出すると

Suggested change
/// または最小値より小さい場合はエラーとなります
/// または最小値より小さい場合はエラーとなることに注意してください

のようになります。

}

/// Determines whether an integer is even.
/// 整数値が偶数かどうかを判断。
Copy link
Contributor

Choose a reason for hiding this comment

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

好みの問題かもしれませんが、「判定」の方が自然な気がします。

}

/// Determines the maximum of a sequence of values.
/// 一連の値の最大値を決定
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 一連の値の最大値を決定
/// 一連の値の最大値を決定

}

/// Determines the minimum of a sequence of values.
/// 一連の値の最小値を決定
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 一連の値の最小値を決定
/// 一連の値の最小値を決定

/// この関数は、演算対象と同じ型の値を返します。つまり、[`float`]に`round`を
/// 適用すると`float`が、[`decimal`]に適用すると`decimal`が返されます。
/// 関数の出力を明示的に[`int`]にすることも可能ですが、その`float`や`decimal`が
/// 64ビット符号つき整数の最大値より大きい場合、または最小値より小さい場合はエラー
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 64ビット符号つき整数の最大値より大きい場合、または最小値より小さい場合はエラー
/// 64ビット符号付き整数の最大値より大きい場合、または最小値より小さい場合はエラー

/// 64ビット符号つき整数の最大値より大きい場合、または最小値より小さい場合はエラー
/// となることに注意してください。
///
/// さらに、この関数は、最大または最小の整数や`decimal`を超えて丸めようとすると
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// さらに、この関数は、最大または最小の整数や`decimal`を超えて丸めようとすると
/// さらに、この関数は、整数や`decimal`の最大値または最小値を超えて丸めようとすると

/// 数値の小数部分を切り出し。
///
/// If the number is an integer, returns `0`.
/// もしその値が整数であれば、「0」を返します。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// もしその値が整数であれば、「0」を返します。
/// もしその値が整数であれば、`0`を返します。

/// error if the resulting [`float`] or [`decimal`] is larger than the maximum
/// 64-bit signed integer or smaller than the minimum for that type.
/// この関数はつねに整数値($int)を返し、結果となる[`float`]や[`decimal`]が
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
/// 64ビット符号付き整数の最大値より大きい、または最小値より小さい場合は

/// error if the resulting [`float`] or [`decimal`] is larger than the maximum
/// 64-bit signed integer or smaller than the minimum for that type.
/// この関数はつねに整数値($int)を返し、結果となる[`float`]や[`decimal`]が
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
/// 64ビット符号付き整数の最大値より大きい、または最小値より小さい場合は

/// error if the resulting [`float`] or [`decimal`] is larger than the maximum
/// 64-bit signed integer or smaller than the minimum for that type.
/// この関数はつねに整数値($int)を返し、結果となる[`float`]や[`decimal`]が
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 64ビット符号つき整数の最大値より大きい、または最小値より小さい場合は
/// 64ビット符号付き整数の最大値より大きい、または最小値より小さい場合は

#[func(title = "Binomial")]
pub fn binom(
/// The upper coefficient. Must be non-negative.
/// 全体の数。0または正の値である必要があります。
Copy link
Contributor

@ultimatile ultimatile Sep 9, 2025

Choose a reason for hiding this comment

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

間違いではないのですが、「下側の係数」と合わせた方が良いかなと思いました。

Suggested change
/// 全体の数。0または正の値である必要があります。
/// 上側の係数。0または正の値である必要があります。

}

/// Calculates the hyperbolic cosine of a hyperbolic angle.
/// 双曲線角の双曲線コサイン。
Copy link
Contributor

Choose a reason for hiding this comment

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

「ハイパーボリックコサイン(双曲線余弦)を計算。」あるいは「ある双曲角のハイパーボリックコサイン(双曲線余弦)。」など

#[func(title = "Hyperbolic Cosine")]
pub fn cosh(
/// The hyperbolic angle whose hyperbolic cosine to calculate.
/// 双曲線コサインを計算する双曲線角。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 双曲線コサインを計算する双曲線角
/// ハイパーボリックコサインを計算する双曲角

}

/// Calculates the hyperbolic tangent of an hyperbolic angle.
/// 双曲線角の双曲線タンジェント。
Copy link
Contributor

Choose a reason for hiding this comment

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

「ハイパーボリックタンジェント(双曲線正接)を計算。」あるいは「ある双曲角のハイパーボリックタンジェント(双曲線正接)。」など

#[func(title = "Hyperbolic Tangent")]
pub fn tanh(
/// The hyperbolic angle whose hyperbolic tangent to calculate.
/// 双曲線タンジェントを計算する双曲線角。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 双曲線タンジェントを計算する双曲線角
/// ハイパーボリックタンジェントを計算する双曲角

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants