@@ -14,6 +14,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
14
14
15
15
翻訳作業は、ユーザーから指定された単一の ` .po ` ファイルに対して行います。一度に複数のファイルを扱ったり、まとめて翻訳したりはしません。
16
16
17
+
18
+
17
19
### 3. 翻訳作業のルール
18
20
19
21
作業を行う際には、以下のルールを厳守してください。
@@ -57,6 +59,67 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
57
59
4 . 既存の翻訳もレビューし、必要に応じて修正案を考えます。
58
60
5 . ` replace ` または ` write_file ` ツールを使い、変更を適用します。
59
61
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
+
60
123
## Repository Structure
61
124
62
125
The repository is organized as follows:
0 commit comments