v2.0.1 업데이트
This commit is contained in:
18
ds_l10n.py
18
ds_l10n.py
@ -79,10 +79,11 @@ def command_extract(args, config, logger):
|
||||
if count > 0:
|
||||
logger.success(f'\n✅ 미번역 항목 {count}건 추출 완료')
|
||||
logger.info(f'📄 출력 파일: {output_path}')
|
||||
return True
|
||||
else:
|
||||
logger.info('추출할 미번역 항목이 없습니다.')
|
||||
return False
|
||||
logger.success(f'\n✅ 모든 텍스트가 번역되어 있습니다!')
|
||||
logger.info('미번역 항목이 없습니다. 번역 작업이 완료된 상태입니다.')
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def command_validate(args, config, logger):
|
||||
@ -116,11 +117,20 @@ def command_validate(args, config, logger):
|
||||
exclude_columns = {'msgctxt', 'SourceLocation', 'msgid'}
|
||||
lang_codes = [col for col in reader.fieldnames if col not in exclude_columns]
|
||||
|
||||
# 원본 언어 (ko가 source language)
|
||||
source_lang = config.get('languages.source', 'ko')
|
||||
|
||||
for row in reader:
|
||||
msgctxt = row.get('msgctxt', '')
|
||||
msgid = row.get('msgid', '')
|
||||
|
||||
# msgid 컬럼이 있으면 사용, 없으면 source language(ko) 사용
|
||||
msgid = row.get('msgid', '') or row.get(source_lang, '')
|
||||
|
||||
for lang in lang_codes:
|
||||
# source language는 원본이므로 검증 스킵
|
||||
if lang == source_lang:
|
||||
continue
|
||||
|
||||
msgstr = row.get(lang, '')
|
||||
if msgstr: # 번역문이 있는 경우만 검증
|
||||
entries.append({
|
||||
|
||||
Reference in New Issue
Block a user