Skip to content

Add Korean support (partial) - #47

Merged
Amato21 merged 2 commits into
masterfrom
add-korean-support
Jul 20, 2026
Merged

Add Korean support (partial)#47
Amato21 merged 2 commits into
masterfrom
add-korean-support

Conversation

@Amato21

@Amato21 Amato21 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

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

  • New src/lang/ko.ts, wired into src/lang/helper.ts and src/settings.ts (new "Korean" toggle), same structure as every other language dict.
  • Core vocabulary (오늘/내일/어제, weekdays, 이번/다음/지난 prefixes, time units) taken directly from CreamNuts' dictionary — credited in README (Supported Languages note + Credits section) and CHANGELOG.
  • Korean phrases relative time in suffix position (3일 후 = "3 days" + "후" ("later") = "in 3 days"), Korean's natural grammar — this reuses the exact mechanism already built for Chinese's 後/后 (later/agosuffix keys), 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:

  • ✅ today/tomorrow/yesterday/now, weekday names with this/next/last, suffix-style relative expressions (3일 후, 2주 전)
  • ❌ weekday + specific time (e.g. 다음 월요일 에 3시) silently drops the time instead of erroring
  • ❌ date ranges (e.g. 월요일 부터 금요일 까지) don't match at all

Root 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

  • 12 new tests (basic expressions, suffix-style relative expressions, weekday prefixes, "X ago", fuzzy-match short-word exclusion) — all passing.
  • Confirmed the tests actually catch a regression: temporarily broke the later/agosuffix keys, reran, 4 tests failed as expected, then passed again after restoring.
  • Full suite: 579/579 passing.
  • npx tsc --noEmit, npx eslint, and npm run build all clean.

Generated by Claude Code

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/lang/ko.ts Outdated
Comment thread src/lang/ko.ts Outdated
- 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
@Amato21
Amato21 merged commit 76a0073 into master Jul 20, 2026
2 checks passed
@Amato21 Amato21 mentioned this pull request Aug 1, 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.

2 participants