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

Skip to content

Commit 3e51fa4

Browse files
committed
update dataclasses.po
1 parent b7ecb96 commit 3e51fa4

File tree

2 files changed

+270
-9
lines changed

2 files changed

+270
-9
lines changed

CLAUDE.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,98 @@ options:
149149
2. 既存翻訳の品質が改善されている
150150
3. コード例等の翻訳不要な部分は適切に `msgstr ""` のまま残されている
151151

152+
### 4.3 翻訳作業完了前の必須チェック手順(最終確認)
153+
154+
**重要**: 翻訳作業の最後には、**必ず**以下の手順を実行して未翻訳部分が残っていないか確認してください。この手順は翻訳作業の品質を保証するために必須です。
155+
156+
#### 最終チェックスクリプトの実行
157+
158+
翻訳対象ファイルに対して以下のPythonスクリプトを実行し、未翻訳のテキストエントリが残っていないか確認します:
159+
160+
```python
161+
python3 -c "
162+
import re
163+
with open('対象ファイル.po', 'r', encoding='utf-8') as f:
164+
content = f.read()
165+
166+
# POエントリを分割して真に空のものをカウント
167+
entries = re.split(r'\n\n(?=#)', content)
168+
empty_count = 0
169+
170+
for i, entry in enumerate(entries):
171+
if 'msgid' in entry and 'msgstr \"\"' in entry:
172+
lines = entry.strip().split('\n')
173+
msgstr_started = False
174+
is_empty = True
175+
176+
# msgidの内容をチェック
177+
msgid_content = ''
178+
for line in lines:
179+
if line.startswith('msgid'):
180+
msgid_content = line
181+
elif line.startswith('\"') and not msgstr_started:
182+
msgid_content += line
183+
184+
# コードサンプルでないテキストエントリかチェック
185+
is_code_only = ('def ' in msgid_content or
186+
'class ' in msgid_content or
187+
'assert ' in msgid_content or
188+
'print(' in msgid_content or
189+
'return ' in msgid_content or
190+
msgid_content.count('\\\\\"') > 2)
191+
192+
for line in lines:
193+
if line.startswith('msgstr'):
194+
msgstr_started = True
195+
if '\"\"' in line and len(line.strip()) > 9:
196+
is_empty = False
197+
break
198+
elif msgstr_started and line.startswith('\"'):
199+
is_empty = False
200+
break
201+
202+
if is_empty and not is_code_only:
203+
empty_count += 1
204+
print(f'未翻訳テキストエントリ {i+1}:')
205+
print(msgid_content[:200] + '...' if len(msgid_content) > 200 else msgid_content)
206+
print('---')
207+
208+
print(f'残り未翻訳テキストエントリ数: {empty_count}')
209+
if empty_count == 0:
210+
print('✅ All translatable text entries have been translated!')
211+
else:
212+
print('⚠️ 未翻訳のテキストエントリが残っています。これらを翻訳してから作業を完了してください。')
213+
"
214+
```
215+
216+
#### チェック結果の処理
217+
218+
1. **未翻訳エントリが見つからない場合(empty_count = 0**:
219+
- 翻訳作業完了
220+
- 「✅ All translatable text entries have been translated!」が表示されることを確認
221+
222+
2. **未翻訳エントリが見つかった場合**:
223+
- **必ず**すべてのエントリを翻訳してから作業を完了する
224+
- 翻訳方針:
225+
- **コードサンプル**: `def``class``assert``print``return`等を含む場合は通常そのままコピー
226+
- **説明文**: 日本語に翻訳
227+
- **エラーメッセージ**: 日本語に翻訳
228+
- **ドキュメント文字列**: 日本語に翻訳
229+
- **技術用語**: 既存の翻訳スタイルに合わせて統一
230+
231+
3. **再チェック**:
232+
- 未翻訳エントリを修正後、再度スクリプトを実行
233+
- 「残り未翻訳テキストエントリ数: 0」になるまで繰り返す
234+
235+
#### このチェックが重要な理由
236+
237+
- 分割→翻訳→結合の過程で翻訳が失われる場合がある
238+
- 大きなファイルでは一部のエントリが見落とされる可能性がある
239+
- 翻訳の品質と完全性を保証するため
240+
- ユーザーに未完成の翻訳を提供することを防ぐため
241+
242+
**注意**: この最終チェックを省略してはいけません。翻訳作業の品質保証において必須の手順です。
243+
152244
## Repository Structure
153245

154246
The repository is organized as follows:

0 commit comments

Comments
 (0)