Add Korean support (partial) - #47
Conversation
Adds src/lang/ko.ts and wires it into the language selector settings and the translation helper, following the same structure as the other 10 language dicts. Core vocabulary (today/tomorrow/yesterday, weekdays, this/next/last prefixes, hour/minute/day/week/month/year units, and the suffix "later"/"agosuffix" markers) is taken from CreamNuts' nldates-obsidian-korean (MIT), since it's vocabulary a real Korean-speaking user base already relies on: https://github.com/CreamNuts/nldates-obsidian-korean Korean phrases relative time in suffix position (number + unit + marker, e.g. "3일 후" = "in 3 days"), not English's prefix style -- the same mechanism already built for Chinese's 後/后, so this needed no new parser code, just the right dict values. Verified empirically (see tests/parser.test.ts): today/tomorrow/ yesterday/now, weekday names with this/next/last, and suffix-style relative expressions all resolve correctly. Also verified two gaps consistent with Korean's grammar (particles like "at"/"from"/"to" attach directly to the previous word with no space, but this plugin's templates expect them as a standalone space-separated word): weekday + specific time silently drops the time, and date ranges don't match at all. Documented in ko.ts, README, CHANGELOG, and issue #40 rather than silently shipped as if fully supported -- marked "Partially supported" in the language table, same tier as German/Portuguese/Chinese. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011AnUmNKkH1y4ZAEPKF1WwQ
There was a problem hiding this comment.
Code Review
This pull request adds partial Korean language support to the natural language dates plugin, introducing a new translation dictionary (src/lang/ko.ts), registering the language in settings, and adding comprehensive parser tests. The review feedback identifies two translation issues in src/lang/ko.ts: the incorrect inclusion of '앞' (meaning 'future') in agosuffix (which should only be '전' for 'ago'), and the translation of the prefix in as '이내' (which means 'within' and acts as a suffix), suggesting '앞으로' as a grammatically correct alternative.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- agosuffix: removed "앞" -- it means "front"/"future", the opposite
of "ago", and could make future expressions parse as past ones.
"전" alone is the correct suffix.
- in: replaced "이내" ("within X", a suffix, semantically different
from "in X" meaning "X from now") with "앞으로", a grammatically
correct prefix-position equivalent.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011AnUmNKkH1y4ZAEPKF1WwQ
Summary
Adds Korean as a 12th supported language, following a suggestion from a real-world Korean-focused plugin (CreamNuts/nldates-obsidian-korean, MIT).
What changed
src/lang/ko.ts, wired intosrc/lang/helper.tsandsrc/settings.ts(new "Korean" toggle), same structure as every other language dict.3일 후= "3 days" + "후" ("later") = "in 3 days"), Korean's natural grammar — this reuses the exact mechanism already built for Chinese's 後/后 (later/agosuffixkeys), so no new parser code was needed.Known limitations (by design, documented — not silently shipped)
chrono-node has no Korean locale at all (verified: ships de/en/es/fi/fr/it/ja/nl/pt/ru/sv/uk/zh, no ko), so Korean gets zero fallback beyond this plugin's own regex patterns — same tier as German/Portuguese/Chinese, marked "Partially supported" in the README table.
Verified empirically what does and doesn't work:
3일 후,2주 전)다음 월요일 에 3시) silently drops the time instead of erroring월요일 부터 금요일 까지) don't match at allRoot cause: Korean particles like "at"/"from"/"to" (에/부터/까지) attach directly to the previous word with no space, but this plugin's templates expect them as a standalone space-separated word — a structural mismatch, not just a missing translation. Documented in
ko.ts's comments and added to #40, which now tracks this pattern across all 4 affected languages as a candidate for one shared fix instead of one-off patches.Verification
later/agosuffixkeys, reran, 4 tests failed as expected, then passed again after restoring.npx tsc --noEmit,npx eslint, andnpm run buildall clean.Generated by Claude Code