Skip to content

Conversation

sbtseiji
Copy link
Contributor

@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
Contributor Author

sbtseiji commented Sep 9, 2025

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

@ultimatile
Copy link
Contributor

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

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

@ultimatile
Copy link
Contributor

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

@3w36zj6
Copy link
Member

3w36zj6 commented Sep 22, 2025

値を表す「-1」は許容されてほしいので、false positiveな気がします。

Run bun run --bun textlint-html
$ textlint ./website/typst-docs-web/dist/

/home/runner/work/docs/docs/website/typst-docs-web/dist/reference/foundations/calc/index.html
  44:6472  error  原則として和文ではハイフン(-)を使用しません。
例外は、住所や電話番号の区切りに使う場合です。  jtf-style/4.2.6.ハイフン(-)
  46:6473  error  原則として和文ではハイフン(-)を使用しません。
例外は、住所や電話番号の区切りに使う場合です。  jtf-style/4.2.6.ハイフン(-)

✖ 2 problems (2 errors, 0 warnings, 0 infos)

error: script "textlint-html" exited with code 1
Error: Process completed with exit code 1.

https://github.com/textlint-ja/textlint-rule-preset-JTF-style/blob/master/test/4.2.6-test.js

このエラーは一旦無視してください。

Copy link
Member

@kimushun1101 kimushun1101 left a comment

Choose a reason for hiding this comment

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

内容の多いページの翻訳ありがとうございます。コメントを入れさせていただきました。

}

/// Rounds a number to the nearest integer away from zero.
/// 数値を0から離れる方向に最も近い整数に丸めます。
Copy link
Member

Choose a reason for hiding this comment

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

原文にPull Requestしたほうが良いかもしれませんが、ちょっと誤解を招きそうな表現ですね。
#calc.round(3.4)は3になり、#calc.round(3.5)は4になるため、普通に四捨五入の処理だと思うのですが。
#calc.round(3.4)が3と4では0から離れるのは4であるため、この表現だと(正の数では)切り上げられるイメージを持ちました。

解釈のご助言があればお願いしたいです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

コメントありがとうございます。原文の意味では「切り上げ」ですね。実際には四捨五入されているのであれば、原文の表現が適切でない(「away frm zero」はない方が正しい)と言うことになります。この場合、ひとまず邦訳は「四捨五入します」としておくのがよいでしょうか。

Copy link
Member

Choose a reason for hiding this comment

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

原文の表現が紛らわしい気がするので、「round half away from zero」と明記するか、「Rounds a number to the nearest integer, with halfway cases (e.g., 0.5, -0.5) rounded away from zero.」のような説明に変更する提案をすると良いと思います。

Copy link
Member

Choose a reason for hiding this comment

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

ひとまず邦訳は「四捨五入します」としておくのがよいでしょうか。

私はよいと思います。 @3w36zj6 さんはどう思いますか?
バージョンアップの際に更新されると思うのですが、コンフリクト処理は面倒になったりしますでしょうか?

本家へのプルリクエストは @sbtseiji さんから行ってみますか?もし面倒であれば私の方から行っても構いませんのでご指定ください。

Copy link
Member

Choose a reason for hiding this comment

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

上流が修正される前提で「四捨五入します」として問題ないです。マージコミットの作成時には正式に採用された文章をもとに再度検討します。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

和訳の方は「四捨五入します」にしておきます。Gitの作業についてはあまり慣れていませんので、本家へのプルリクエストについては、@kimushun1101 様にお願いできるとありがたいです。

sbtseiji and others added 6 commits October 1, 2025 16:03
Co-authored-by: Shunsuke KIMURA <kimushun1101@gmail.com>
Co-authored-by: Shunsuke KIMURA <kimushun1101@gmail.com>
Co-authored-by: Shunsuke KIMURA <kimushun1101@gmail.com>
Co-authored-by: Shunsuke KIMURA <kimushun1101@gmail.com>
Co-authored-by: Shunsuke KIMURA <kimushun1101@gmail.com>
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.

4 participants