v2.0.1 업데이트
This commit is contained in:
@ -180,15 +180,16 @@ class TranslationValidator:
|
||||
"""줄바꿈 문자 확인"""
|
||||
issues = []
|
||||
|
||||
# \r\n, \n, \r 개수 확인
|
||||
orig_crlf = original.count('\\r\\n')
|
||||
trans_crlf = translation.count('\\r\\n')
|
||||
# 실제 escape sequence (\r\n, \n, \r) 개수 확인
|
||||
# 주의: '\r\n'은 실제 CR+LF 문자 (2바이트), '\\r\\n'은 리터럴 문자열 (4바이트)
|
||||
orig_crlf = original.count('\r\n')
|
||||
trans_crlf = translation.count('\r\n')
|
||||
|
||||
orig_lf = original.count('\\n') - orig_crlf # \\r\\n에 포함된 \\n 제외
|
||||
trans_lf = translation.count('\\n') - trans_crlf
|
||||
orig_lf = original.count('\n') - orig_crlf # \r\n에 포함된 \n 제외
|
||||
trans_lf = translation.count('\n') - trans_crlf
|
||||
|
||||
orig_cr = original.count('\\r') - orig_crlf # \\r\\n에 포함된 \\r 제외
|
||||
trans_cr = translation.count('\\r') - trans_crlf
|
||||
orig_cr = original.count('\r') - orig_crlf # \r\n에 포함된 \r 제외
|
||||
trans_cr = translation.count('\r') - trans_crlf
|
||||
|
||||
if orig_crlf != trans_crlf or orig_lf != trans_lf or orig_cr != trans_cr:
|
||||
issues.append(ValidationIssue(
|
||||
|
||||
Reference in New Issue
Block a user