Skip to content

Add Korean (ko) interface language and write Hangul into PDFs - #2528

Open
luff-mitchell wants to merge 2 commits into
storytold:mainfrom
luff-mitchell:feat/ko-catalog
Open

luff-mitchell wants to merge 2 commits into
storytold:mainfrom
luff-mitchell:feat/ko-catalog

Conversation

@luff-mitchell

@luff-mitchell luff-mitchell commented Oct 15, 2026 •

Copy link
Copy Markdown

What this changes

Adds Korean (한국어, ko) as an interface language and lets PdfCraft write Hangul into PDFs.

  • crates/ui-egui/src/i18n/ko.tsv: full catalog, 2,672 entries (menus, tools, dialogs, notices, plurals; {placeholders} and trailing "…" match the English source). Registered in LANGUAGES.
  • crates/engine/src/dates.rs: Korean month and day names for date fields (mirrors the interface languages; the existing test enforces it).
  • Nanum Gothic UI face (from craft-fonts, CRAFT_FONTS_DIR), ahead of the Japanese faces in Korean mode. Builds without it use an installed Hangul face at runtime (Malgun Gothic, Apple SD Gothic Neo, Nanum); nothing is embedded.
  • Hangul in PDFs: Add text (shaped Type 3 with ToUnicode and ActualText) and replaced lines (Type 3 from the Hang face), including wrapping at spaces. Without the font the tool refuses with a clear error instead of writing tofu.
  • Docs: localization.md, localization-parity.md, gaps.md, ROADMAP.md, ATTRIBUTION.*.

Provenance and translation disclosure

  • AI-assisted translation. The catalog was drafted by Claude (Anthropic) from the English source strings only. No other product's Korean strings, screens or glossaries were consulted (clean-room, same as the other catalogs).
  • Review. The catalog was reviewed by a Korean-speaking contributor together with Google Gemini. Gemini proposed alternative wordings for the Claude draft; the contributor chose which to adopt, and 55 edits were applied (mainly terms: Redact, Sanitize, Flatten, Output intent). Gemini saw only the existing draft and PdfCraft strings; no third-party product strings were used. The 80 entries for strings that landed on main after that review (word count, Full Screen prompt, untagged content, print notices, the password minimum, the revision and snapshot notices) are Claude's draft and not yet reviewed. Further wording fixes from other native speakers are welcome.
  • No font file is committed here; fonts live in storytold/craft-fonts (companion PR: Add Nanum Gothic Regular (Hang) for the Korean interface craft-fonts#29).
  • No asset from an Adobe product; no GPL/AGPL code.

How you verified it

  • cargo fmt --check
  • clippy -D warnings on pdfcraft-ui-egui, pdfcraft-engine, pdfcraft-fonts, pdfcraft-edit
  • rebased onto main f0c9901 on 2026-10-16; tests on the crates I changed: engine 274, edit 158, fonts 70, ui-egui lib 437 all pass, and with CRAFT_FONTS_DIR set the fonts.rs Korean glyph test passes too. I did not run the whole workspace.
  • The 8 ui-egui tests that failed on the earlier main (afa8e18) pass on the rebased branch, because main has since fixed them. None involved ko.
  • cargo xtask layers and cargo xtask assets
  • Visual: rendered a page with added Hangul text through pdftoppm; the UI was run on Windows with the Hang font and shows Hangul correctly.

Never-crash / Security

No new unwrap/expect/panic! in non-test code, no indexing with input-derived positions, no unsafe, no new network access, no change to --root confinement.

Anything a reviewer should look at first

  • Fill & Sign / date text and form fields still use WinAnsi only; Hangul there is not written yet (noted in localization-parity.md).
  • Comment text boxes (FreeText annotations) are drawn in Helvetica with WinAnsi encoding, so Hangul typed there still shows as ?. This is the existing limit for every non-Latin script, and is not changed here. It would be a separate follow-up.
  • parity/ has no Korean-interface row, so none was changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxYuVzYKY6M4RXSDFiCpKR

- ko.tsv: 2,669 clean-room entries written from the English meaning (합니다체/해요체
  mix as in the catalog header); covers every key the other catalogs have. Drafted by
  Claude from the English strings only; reviewed by a Korean-speaking contributor with
  Google Gemini (55 edits, mostly terms: Redact, Sanitize, Flatten, Output intent).
- Register `ko` in LANGUAGES and in the date languages (month/weekday names).
- Fonts: `Hang` script support. ui_korean_fonts() picks craft-fonts faces covering
  Hangul; Korean mode puts them ahead of the Japanese CJK faces, and the web build
  embeds them. Needs NanumGothic (OFL-1.1) in storytold/craft-fonts, otherwise the
  build still works and falls back to an installed Hangul face (Malgun Gothic, Apple SD
  Gothic Neo, Nanum), read at runtime and never embedded.
- Tests: Korean glyph/ordering test, date names, catalog consistency lists.
- Docs: localization.md, localization-parity.md, gaps.md storytold#14, ROADMAP.md, ATTRIBUTION.

Not covered here: writing Hangul into edited PDFs (next commit).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxYuVzYKY6M4RXSDFiCpKR

This branch has not been deployed

No deployments
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.

2 participants