Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
heh
  • Loading branch information
atsuoishimoto committed Jul 6, 2025
commit a52b353072bd6446e674376b1eec923271bd20ed
63 changes: 63 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

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



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

作業を行う際には、以下のルールを厳守してください。
Expand Down Expand Up @@ -57,6 +59,67 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4. 既存の翻訳もレビューし、必要に応じて修正案を考えます。
5. `replace` または `write_file` ツールを使い、変更を適用します。

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

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


```
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 200 library/pathlib.po`

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

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`





## Repository Structure

The repository is organized as follows:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ git+https://github.com/sphinx-doc/sphinx-intl@6b3913fea5a8c9b819818b9b28b6d0d0b6
powrap
pospell
pomerge
translate-toolkit