Skip to content

Claude 1 #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
233 changes: 233 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

# GEMINI.md: python-docs-ja プロジェクト ガイドライン

### 1. プロジェクト概要

このプロジェクトは、プログラミング言語Pythonの公式ドキュメントを日本語に翻訳する、Pythonプロジェクト公式の翻訳チームです。

### 2. 基本的なワークフロー

翻訳作業は、ユーザーから指定された単一の `.po` ファイルに対して行います。一度に複数のファイルを扱ったり、まとめて翻訳したりはしません。



### 3. 翻訳作業のルール

作業を行う際には、以下のルールを厳守してください。

#### 3.1. poファイルのフォーマットを維持する

- 翻訳は gettext を利用した `.po` ファイル形式で行われます。
- `msgid` (原文) と `msgstr` (訳文) のペアで構成されています。
- **絶対に `.po` ファイルの構造を壊さないでください。** 翻訳対象は `msgstr` の中身だけです。

#### 3.2. reStructuredTextの構文を維持する

- ドキュメントは reStructuredText で記述されています。
- ``:mod:`` のようなロールや、`.. note::` のようなディレクティブ、リンクなどの構文を壊さないように、細心の注意を払って翻訳してください。

#### 3.3. 翻訳の進め方

- **既存翻訳の確認:** すでに翻訳されている箇所 (`msgstr` に記述がある箇所) は、原文 (`msgid`) の内容が正しく反映されているかを確認します。必要であれば、より適切で自然な表現に修正します。
- **未翻訳部分の翻訳:** `msgstr` が空になっている未翻訳の部分は、他の部分の翻訳スタイルやトーンと違和感がないように、自然な日本語訳を作成・追加します。

#### 3.4. 翻訳品質の自動改善

翻訳作業時は、特別な指示がなくても以下の点を自動的にチェックし、読みにくい訳文を改善してください:

- **不自然な表現の修正:** 「だったり」「させる」などの不自然な語尾や接続表現を自然な日本語に修正
- **用語の統一:** 同じ概念を表す用語は一貫して使用(例:「並行処理」「並列処理」の使い分け)
- **技術用語の日本語化:** 一般的に日本語化されている用語は日本語で記述(例:「Transport」→「トランスポート」、「subprocesses」→「サブプロセス」)
- **語尾の統一:** 箇条書きなどでは語尾をですます調に統一
- **読みやすさの向上:** 冗長な表現を簡潔にし、より自然で読みやすい日本語に改善
- **文脈に適した表現:** 技術文書として適切な表現を選択

これらの改善は、翻訳の正確性を保ちながら、より自然で読みやすい日本語文書にするために行います。

### 4. 具体的な作業例

「`library/asyncio.po` を翻訳してください」という指示があった場合、以下の手順で作業を進めます。

1. `read_file` ツールで `library/asyncio.po` の内容を読み込みます。
2. 未翻訳の箇所 (`msgstr ""`) を見つけます。
3. reStructuredTextの構文に注意しながら、対応する `msgid` を翻訳し、`msgstr` に記述します。
4. 既存の翻訳もレビューし、必要に応じて修正案を考えます。
5. `replace` または `write_file` ツールを使い、変更を適用します。

#### 4.1 ファイルの分割

.poファイルのサイズが20kbを超える場合は、すべてをまとめて処理せず、splitpoコマンドでpoファイルを50エントリずつに分割して、それぞれを翻訳します。


```
splitpo -h
usage: splitpo [-h] [-o OUTPUT_DIR] [-e ENTRIES] input_file

Split a .po file into chunks by entry count

positional arguments:
input_file Input .po file to split

options:
-h, --help show this help message and exit
-o, --output-dir OUTPUT_DIR
Output directory for split files
-e, --entries ENTRIES
Number of entries per split file (default: 100)

```

実行例:

`splitpo -o /tmp/split_pathlib -e 50 library/pathlib.po`

このコマンドは、poファイルを50エントリごとに分割します。

Split files are named with the pattern `{original_name}_part_{number}.po`:
- `input.po` → `input_part_000.po`, `input_part_001.po`, etc.
- Number of digits adjusts to file count (minimum 3 digits)
- Numbering starts from 0

ファイル名をそのままソートすれば、元ファイルと同じ順番で並ぶようになっていますので、この順序で翻訳を進めてください。

それぞれのファイルの翻訳が終了したら、joinpoコマンドで分割したファイルを結合します。


```
joinpo -h
usage: joinpo [-h] -o OUTPUT input_files [input_files ...]

Join split .po files back together

positional arguments:
input_files Input .po files to join (supports wildcards)

options:
-h, --help show this help message and exit
-o, --output OUTPUT Output .po file
```

実行例:

`joinpo -o translated_pathlib.po /tmp/split_pathlib/*.po -o`





### 4.2 翻訳の完全性

翻訳作業では、**翻訳が必要なすべてのエントリを必ず翻訳する**必要があります。一部だけを残すことは許可されません。

#### 翻訳が必要なエントリの判別

- **翻訳が必要**: 説明文、エラーメッセージ、ドキュメント本文など
- **翻訳不要(`msgstr ""`のまま)**:
- コード実行例(`>>> ...`形式のPythonコード)
- プログラムコードサンプル
- ファイルパス例
- 設定値例
- コマンド出力例

#### 翻訳作業の要件

1. **完全性の確保**: 翻訳が必要なすべてのエントリを必ず翻訳する
2. **抜け漏れなし**: 時間的制約に関係なく、すべての翻訳対象エントリを完了させる
3. **系統的な作業**: 分割ファイルでも各ファイルのすべての翻訳対象エントリを完了してから次に進む
4. **既存翻訳の確認**: 新規翻訳だけでなく、既存の翻訳についても品質をチェックし、必要に応じて改善する

#### 翻訳完了の確認

翻訳作業を完了する前に、以下を確認してください:

1. すべての説明文が翻訳されている
2. 既存翻訳の品質が改善されている
3. コード例等の翻訳不要な部分は適切に `msgstr ""` のまま残されている

## Repository Structure

The repository is organized as follows:
- Root level: Core documentation files (about.po, bugs.po, copyright.po, etc.)
- `c-api/`: C API documentation translations
- `library/`: Standard library documentation translations
- `tutorial/`: Tutorial documentation translations
- `reference/`: Language reference translations
- `whatsnew/`: "What's New" documentation for different Python versions
- `deprecations/`: Deprecation notices
- `extending/`, `distributing/`, `installing/`: Advanced topics
- `faq/`, `howto/`: FAQ and how-to guides
- `using/`: Platform-specific usage guides

## Common Development Commands

### Build Documentation
```bash
make # Build HTML documentation locally
make htmlview # Build and open documentation in browser
```

### Translation Management
```bash
make todo # List remaining translation tasks and show progress
make fuzzy # Find fuzzy translation strings that need review
make wrap # Rewrap modified .po files to fix line lengths
```

### Quality Assurance
```bash
make verifs # Run all verification checks (spell, line-length, sphinx-lint)
make spell # Check spelling in translation files
make line-length # Check for lines exceeding 80 characters
make sphinx-lint # Run Sphinx linting on .po files
```

### Maintenance
```bash
make clean # Remove build artifacts and temporary files
scripts/update.sh # Pull latest translations from Transifex (requires setup)
```

## Prerequisites

Before working with this repository, ensure you have the required dependencies:

```bash
# Install CPython documentation build dependencies
python -m pip install -r venv/cpython/Doc/requirements.txt

# Required tools (installed via pip or system package manager)
pip install powrap pospell pomerge potodo
```

## Translation Workflow

1. **Translation Source**: Translations are managed via Transifex, not directly in this repository
2. **File Generation**: .po files are generated from Transifex translations
3. **Local Building**: Use `make` commands to build and verify translations locally
4. **Issue Reporting**: Report translation issues to [python-doc-ja repository](https://github.com/python-doc-ja/python-doc-ja/issues)

## Architecture Notes

- **CPython Integration**: The build system clones CPython repository into `venv/cpython/` and builds documentation using CPython's Sphinx configuration
- **Commit Tracking**: `CPYTHON_CURRENT_COMMIT` in Makefile tracks the specific CPython commit used for generating .po files
- **Excluded Files**: Older Python version documentation (2.x, 3.0-3.10) are excluded from translation
- **Language Configuration**: Target language is Japanese (`ja`), branch is `3.14`

## File Format

All translation files are in gettext .po format containing:
- Original English text (`msgid`)
- Japanese translation (`msgstr`)
- Translation metadata and comments
- Fuzzy markers for translations needing review

## Pull Request Policy

This repository does not accept pull requests. Translation changes must be made through the Transifex platform and will be automatically synchronized to this repository.


49 changes: 21 additions & 28 deletions library/asyncio.po
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ msgid ""
"asyncio is a library to write **concurrent** code using the **async/await** "
"syntax."
msgstr ""
"asyncio は **async/await** 構文を使い **並行処理の** コードを書くためのライブ"
"ラリです。"
"asyncio は **async/await** 構文を使い **並行** コードを書くためのライブラ"
"リです。"

#: ../../library/asyncio.rst:25
msgid ""
Expand All @@ -79,43 +79,42 @@ msgid ""
"asyncio is often a perfect fit for IO-bound and high-level **structured** "
"network code."
msgstr ""
"asyncio は多くの場合、 IOバウンドだったり高レベルの **構造化された** ネット"
"ワークコードに完璧に適しています。"
"asyncio は多くの場合、IOバウンドや高レベルの **構造化された** ネットワー"
"クコードに完璧に適しています。"

#: ../../library/asyncio.rst:32
msgid "asyncio provides a set of **high-level** APIs to:"
msgstr "asyncio は次の目的で **高レベル** API を提供しています:"
msgstr "asyncio は以下の目的で **高レベル** API を提供しています:"

#: ../../library/asyncio.rst:34
msgid ""
":ref:`run Python coroutines <coroutine>` concurrently and have full control "
"over their execution;"
msgstr ""
"並行に :ref:`Python コルーチンを起動 <coroutine>` し、実行全体を管理する"
"並行に :ref:`Python コルーチンを実行 <coroutine>` し、その実行を完全に制御する"

#: ../../library/asyncio.rst:37
msgid "perform :ref:`network IO and IPC <asyncio-streams>`;"
msgstr ":ref:`ネットワーク IO と IPC <asyncio-streams>` を執り行う"
msgstr ":ref:`ネットワーク IO と IPC <asyncio-streams>` を実行する"

#: ../../library/asyncio.rst:39
msgid "control :ref:`subprocesses <asyncio-subprocess>`;"
msgstr ":ref:`subprocesses <asyncio-subprocess>` を管理する"
msgstr ":ref:`サブプロセス <asyncio-subprocess>` を管理する"

#: ../../library/asyncio.rst:41
msgid "distribute tasks via :ref:`queues <asyncio-queues>`;"
msgstr ":ref:`キュー <asyncio-queues>` を使ってタスクを分散する"

#: ../../library/asyncio.rst:43
msgid ":ref:`synchronize <asyncio-sync>` concurrent code;"
msgstr "並列処理のコードを :ref:`同期 <asyncio-sync>` させる"
msgstr "並行処理のコードを :ref:`同期 <asyncio-sync>` する"

#: ../../library/asyncio.rst:45
msgid ""
"Additionally, there are **low-level** APIs for *library and framework "
"developers* to:"
msgstr ""
"これに加えて、 *ライブラリやフレームワークの開発者* が次のことをするための **"
"低レベル** API があります:"
"さらに、*ライブラリやフレームワークの開発者*向けには以下の **低レベル** API があります:"

#: ../../library/asyncio.rst:48
msgid ""
Expand All @@ -124,48 +123,43 @@ msgid ""
"`subprocesses <loop_subprocess_exec>`, handling :ref:`OS signals "
"<loop_add_signal_handler>`, etc;"
msgstr ""
":ref:`ネットワーク通信 <loop_create_server>` 、 :ref:`サブプロセス "
"<loop_subprocess_exec>` の実行、 :ref:`OS シグナル "
"<loop_add_signal_handler>` の取り扱いなどのための非同期 API を提供する :ref:`"
"イベントループ <asyncio-event-loop>` の作成と管理を行う"
":ref:`イベントループ <asyncio-event-loop>` を作成・管理し、:ref:`ネットワーク通信 <loop_create_server>`、:ref:`サブプロセスの実行 <loop_subprocess_exec>`、:ref:`OS シグナルの取り扱い <loop_add_signal_handler>` などのための非同期 API を提供する"

#: ../../library/asyncio.rst:53
msgid ""
"implement efficient protocols using :ref:`transports <asyncio-transports-"
"protocols>`;"
msgstr ""
":ref:`Transport <asyncio-transports-protocols>` を使った効率的な protocol を"
"実装します"
":ref:`トランスポート <asyncio-transports-protocols>` を使った効率的なプロ"
"トコルを実装する"

#: ../../library/asyncio.rst:56
msgid ""
":ref:`bridge <asyncio-futures>` callback-based libraries and code with async/"
"await syntax."
msgstr ""
"コールバックを用いたライブラリと async/await 構文を使ったコードの :ref:`橋渡"
"し <asyncio-futures>`"
"コールバックベースのライブラリと async/await 構文を使ったコードを :ref:`ブリッジする <asyncio-futures>`"

#: ../../includes/wasm-notavail.rst:3
msgid "Availability"
msgstr ""
msgstr "利用可能性"

#: ../../includes/wasm-notavail.rst:5
msgid ""
"This module does not work or is not available on WebAssembly. See :ref:`wasm-"
"availability` for more information."
msgstr ""
"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:"
"`wasm-availability` を見てください。"
"このモジュールは WebAssembly では動作しないか、利用できません。詳しくは :ref:`wasm-availability` を参照してください。"

#: ../../library/asyncio.rst:64
msgid "asyncio REPL"
msgstr ""
msgstr "asyncio REPL"

#: ../../library/asyncio.rst:65
msgid ""
"You can experiment with an ``asyncio`` concurrent context in the :term:"
"`REPL`:"
msgstr ""
msgstr "":term:`REPL` で ``asyncio`` の並行コンテキストを試すことができます:"

#: ../../library/asyncio.rst:67
msgid ""
Expand All @@ -184,18 +178,17 @@ msgid ""
"Raises an :ref:`auditing event <auditing>` ``cpython.run_stdin`` with no "
"arguments."
msgstr ""
"引数無しで :ref:`監査イベント <auditing>` ``cpython.run_stdin`` を送出しま"
"す。 "
"引数なしで :ref:`監査イベント <auditing>` ``cpython.run_stdin`` を発生させます。"

#: ../../library/asyncio.rst:79
msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events."
msgstr ""
msgstr "(3.11.10, 3.10.15, 3.9.20, 3.8.20 でも同様) 監査イベントを発行します。"

#: ../../library/asyncio.rst:82
msgid ""
"Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also "
"executed. Emits audit events."
msgstr ""
msgstr "可能であれば PyREPL を使用し、その場合 :envvar:`PYTHONSTARTUP` も実行されます。監査イベントを発行します。"

#: ../../library/asyncio.rst:90
msgid "Reference"
Expand Down
Loading