Skip to content

feat: spelled-out Korean readings (hangul / formal / hanja) - #26

Merged
jlc488 merged 1 commit into
mainfrom
feat/korean-reading-styles
Nov 8, 2026
Merged

jlc488 merged 1 commit into
mainfrom
feat/korean-reading-styles

Conversation

@jlc488

@jlc488 jlc488 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What

toKorean gains a style option next to the existing mixed 150만, and the DOM hint reads the same choice from data-numkey-korean-style:

style 1,500,000 for
mixed (default, unchanged) 150만 banking UIs
hangul 백오십만 spoken reading / 안내 문구 — leading 일 dropped (천오백, 만 오천) but kept before 억 and above (일억)
formal 일백오십만 계약서·영수증 — every 일 written, no spaces by default
hanja 壹佰伍拾萬 갖은자 anti-forgery numerals — 수표·어음·입금표
  • Default unchanged; unknown style values fall back to mixed (a DOM attribute typo degrades, never throws).
  • formal/hanja default to no group spacing (one unbroken document token); spacing: true opts back in.
  • The 금 … 원정 / 일금 … 원整 frame stays the caller's business, same as 원 today.
  • fromKorean reads hangul/formal output back (round-trip tests); 갖은자 input is out of scope.
  • New exported type KoreanReadingStyle.

한국어

한글 금액 병기에 완전 표기 3종 추가 — hangul(백오십만, 말하듯이)·formal(일백오십만, 계약서·영수증)·hanja(壹佰伍拾萬, 갖은자). 기본값은 기존 150만 그대로이고, 앞뒤 금 … 원정 틀은 서식마다 달라 호출자가 붙입니다.

Verification

  • npm run verify green locally: brand check, typecheck, 128 tests (14 new: 11 in korean.test.ts, 3 in dom.test.ts), ESM/CJS/IIFE/DTS build.
  • Demo page: new side-by-side table checked in the browser pane via DOM measurement — live updates on typing, uniform row heights, no horizontal overflow at 375px (note column hidden under 480px, long readings wrap).
  • README en/ko attribute table + new subsection, CHANGELOG Unreleased entry.

No version bump — release is a separate step per CONTRIBUTING.

toKorean gains a `style` option next to the existing mixed "150만":

- hangul  "백오십만"   — spoken reading, leading 일 dropped (천오백, 만 오천)
                       but kept before 억 and above (일억, 일조)
- formal  "일백오십만" — 계약서·영수증: every 일 written, no spaces by default
- hanja   "壹佰伍拾萬" — 갖은자 anti-forgery numerals (수표·어음·입금표)

The DOM hint reads the same choice from `data-numkey-korean-style`. The
default is unchanged, unknown values fall back to mixed, and the "금 … 원정"
frame stays the caller's business. New exported type KoreanReadingStyle.

Demo page shows the three styles side by side; README en/ko and CHANGELOG
updated.
@jlc488
jlc488 merged commit 7808d8f into main Nov 8, 2026
1 check passed
@jlc488
jlc488 deleted the feat/korean-reading-styles branch November 8, 2026 14:50
@jlc488 jlc488 mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant