(i18n) Improve Korean `ko.ts` error messages to read naturally
Related to #1453 and #1486 (the same problem for Japanese).
Problem
ko.ts is a direct translation of en.ts, so it embeds issue.expected / issue.received and programmer-oriented symbols (>=, <=, !) into Korean sentences. The results are hard to read for Korean speakers, especially end users who see them in forms.
Actual output with @valibot/i18n 1.3.0 and setGlobalConfig({ lang: 'ko' }):
| Schema | Input | Message |
|---|---|---|
nonEmpty() |
'' |
값이 비어 있습니다: 0 을(를) 받았습니다 |
minLength(8) |
'abc' |
길이가 너무 짧습니다: >=8 을(를) 예상했으나 3 을(를) 받았습니다 |
maxLength(5) |
'abcdefg' |
길이가 너무 깁니다: <=5 을(를) 예상했으나 7 을(를) 받았습니다 |
notValue('banned') |
'banned' |
허용되지 않는 값: !"banned" 을(를) 예상했으나 "banned" 을(를) 받았습니다 |
Specific issues:
>=8,<=5,!"banned"read unnaturally inside a Korean sentence.을(를)is a placeholder-style particle that looks machine-generated, and the space before it (0 을(를)) is grammatically incorrect.- Some terms are mistranslated, e.g. graphemes →
문자 그래프(should be문자소),empty→유효하지 않은 비어있음,includes→유효하지 않은 포함.
Proposal
Similar to #1486, use issue.requirement instead of issue.expected and rephrase messages into natural Korean, while keeping the received value for debugging:
nonEmpty: (issue) => `값이 비어 있습니다`,
minLength: (issue) => `길이가 너무 짧습니다: ${issue.requirement}자 이상이어야 하지만 ${issue.received}자입니다`,
maxLength: (issue) => `길이가 너무 깁니다: ${issue.requirement}자 이하여야 하지만 ${issue.received}자입니다`,
notValue: (issue) => `허용되지 않는 값입니다: ${issue.received}`,If the direction of #1453 (e.g. a separate user-friendly variant) is decided first, I'm happy to follow it and contribute the Korean messages. Otherwise I can open a PR that only fixes the mistranslations and the particle spacing.
Source: open-circle/valibot