Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a52b353

Browse files
committed
heh
1 parent b8b816d commit a52b353

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

CLAUDE.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1414

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

17+
18+
1719
### 3. 翻訳作業のルール
1820

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

62+
#### 4.1 ファイルの分割
63+
64+
.poファイルのサイズが5kbを超える場合は、すべてをまとめて処理せず、splitpoコマンドでpoファイルを複数に分割してそれぞれを翻訳します。
65+
66+
67+
```
68+
splitpo -h
69+
usage: splitpo [-h] [-o OUTPUT_DIR] [-e ENTRIES] input_file
70+
71+
Split a .po file into chunks by entry count
72+
73+
positional arguments:
74+
input_file Input .po file to split
75+
76+
options:
77+
-h, --help show this help message and exit
78+
-o, --output-dir OUTPUT_DIR
79+
Output directory for split files
80+
-e, --entries ENTRIES
81+
Number of entries per split file (default: 100)
82+
83+
```
84+
85+
実行例:
86+
87+
`splitpo -o /tmp/split_pathlib -e 200 library/pathlib.po`
88+
89+
このコマンドは、poファイルを200エントリごとに分割します。
90+
91+
Split files are named with the pattern `{original_name}_part_{number}.po`:
92+
- `input.po``input_part_000.po`, `input_part_001.po`, etc.
93+
- Number of digits adjusts to file count (minimum 3 digits)
94+
- Numbering starts from 0
95+
96+
ファイル名をそのままソートすれば、元ファイルと同じ順番で並ぶようになっていますので、この順序で翻訳を進めてください。
97+
98+
それぞれのファイルの翻訳が終了したら、joinpoコマンドで分割したファイルを結合します。
99+
100+
101+
```
102+
joinpo -h
103+
usage: joinpo [-h] -o OUTPUT input_files [input_files ...]
104+
105+
Join split .po files back together
106+
107+
positional arguments:
108+
input_files Input .po files to join (supports wildcards)
109+
110+
options:
111+
-h, --help show this help message and exit
112+
-o, --output OUTPUT Output .po file
113+
```
114+
115+
実行例:
116+
117+
`joinpo -o translated_pathlib.po /tmp/split_pathlib/*.po -o`
118+
119+
120+
121+
122+
60123
## Repository Structure
61124

62125
The repository is organized as follows:

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ git+https://github.com/sphinx-doc/sphinx-intl@6b3913fea5a8c9b819818b9b28b6d0d0b6
33
powrap
44
pospell
55
pomerge
6+
translate-toolkit

0 commit comments

Comments
 (0)