Skip to content

Conversation

@3w36zj6
Copy link
Member

@3w36zj6 3w36zj6 commented May 20, 2025

変更点

  • 新しいWebサイトに各ページの翻訳状態をコードベースで管理する機能を実装した

背景

現在は翻訳状況をメタIssueで管理していますが、将来的にWebサイト上で各ページの翻訳状態や翻訳率を表示したいことを考えると、コードベースでも翻訳状況を管理した方が良いと思います。

@3w36zj6 3w36zj6 requested a review from Copilot May 20, 2025 13:47
Copy link
Contributor

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 pull request implements a code-based system for managing the translation status of website pages. Key changes include:

  • Adding a JSON schema (translation-status.schema.json) to validate translation state data.
  • Creating a translation-status.json file that maps page routes to their translation status.
  • Implementing utility functions in translationStatus.ts to load, save, register routes, and calculate translation progress, with integration in index.tsx to register new routes.

Reviewed Changes

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

File Description
website/translation-status.schema.json New JSON schema for validating the translation status file
website/translation-status.json New JSON file mapping website routes to translation statuses
website/src/utils/translationStatus.ts Utility functions for managing translation status, including file I/O and progress calculation
website/src/index.tsx Integration of route registration using the new translation status mechanism
Comments suppressed due to low confidence (1)

website/src/utils/translationStatus.ts:13

  • Using process.cwd() to resolve the translation status file path may lead to unexpected behavior if the working directory changes. Consider using __dirname (or an equivalent approach) for a more predictable file path resolution.
const TRANSLATION_STATUS_FILE = path.resolve(process.cwd(), "translation-status.json");

@kimushun1101
Copy link
Member

kimushun1101 commented May 22, 2025

このプルリクエストの確認をさせてください。

現在は状態管理用のファイルwebsite/translation-status.jsoncalculateTranslationProgressRateなどの関数を作成しただけで、これを用いた表示部分は後に作るという理解でよろしいでしょうか?

運用としては、翻訳のプルリクエストの際にwebsite/translation-status.jsonの編集も混ぜ込むということでよろしいでしょうか?このコミット typst-jp/typst-jp.github.io@9bd453e を参考にしています。

@3w36zj6
Copy link
Member Author

3w36zj6 commented May 22, 2025

現在は状態管理用のファイルwebsite/translation-status.jsoncalculateTranslationProgressRateなどの関数を作成しただけで、これを用いた表示部分は後に作るという理解でよろしいでしょうか?

はい。

運用としては、翻訳のプルリクエストの際にwebsite/translation-status.jsonの編集も混ぜ込むということでよろしいでしょうか?

同じ認識です。Webサイト側でこの機能を利用した箇所が追加された段階でCONTRIBUTINGに追記しようと考えています。

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.

ご回答ありがとうございました。問題ないと思います。
そこまで大規模でもないため、関数のテストや修正が必要であれば機能実装の際に行いましょう。

@3w36zj6 3w36zj6 merged commit e6190db into main May 22, 2025
3 checks passed
@3w36zj6 3w36zj6 deleted the feature/add-translation-status-management branch May 22, 2025 08:36
@kimushun1101 kimushun1101 added the enhancement New feature or request label May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants