Skip to content

feat(languages): add Korean language support#170

Merged
max-niederman merged 2 commits intomax-niederman:mainfrom
hulryung:feat/korean-language
Mar 12, 2026
Merged

feat(languages): add Korean language support#170
max-niederman merged 2 commits intomax-niederman:mainfrom
hulryung:feat/korean-language

Conversation

@hulryung
Copy link
Contributor

Summary

  • Add korean100 and korean200 word lists based on Korean word frequency data
  • Fix IME cursor positioning in the Input box so that Korean character composition displays correctly in the terminal

Details

Korean word lists

  • korean100: 100 most frequently used Korean words
  • korean200: 200 most frequently used Korean words

IME cursor fix

Korean (and other CJK languages) requires IME composition in the terminal. Without proper cursor positioning, the IME preedit text renders at an unexpected location, causing visual overlap. This fix positions the cursor at the end of the input text during the Test state so the IME composition preview appears in the correct place.

Changed file: src/main.rs

  • Added ratatui::layout::{Constraint, Direction, Layout} imports
  • Set cursor position inside Terminal::draw() for the Test state using the same layout constraints as ui.rs

Test plan

  • Run ttyper -l korean100 and verify Korean words display correctly
  • Type Korean characters and verify IME composition renders inside the Input box without overlap
  • Verify existing languages (e.g. english100) still work as before
  • Verify Results screen still hides the cursor

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e5e978be7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

src/main.rs Outdated
let progress_width =
ratatui::text::Line::from(test.words[test.current_word].progress.as_str())
.width() as u16;
f.set_cursor(inner_x + progress_width, inner_y);

Choose a reason for hiding this comment

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

P2 Badge Clamp IME cursor position to the input field width

The cursor X coordinate is computed as inner_x + progress_width without bounding it to the input box width, so when users overtype (or run in a narrow terminal) the cursor is moved outside the Input widget. In those cases IME preedit text can render outside/wrap away from the input area, which defeats the composition-positioning fix for exactly the long-input scenarios it should handle.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sloplord is correct here @hulryung

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed in 4b1eca6 — cursor X is now clamped to the input widget bounds.

소리
지나다
이제
내다

Choose a reason for hiding this comment

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

P2 Badge Trim korean100 preset to 100 words

The korean100 resource includes entries beyond line 100, so -l korean100 actually draws from 106 words instead of the advertised 100. This makes benchmark presets inconsistent with their names (and with other *100 language files), which can skew test comparability for users relying on fixed-size lists.

Useful? React with 👍 / 👎.

나이
서로

Choose a reason for hiding this comment

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

P2 Badge Trim korean200 preset to 200 words

The korean200 resource has words past line 200, so this preset uses 205 words instead of 200. As with korean100, this breaks the implied contract of count-suffixed language presets and can produce non-comparable results versus other fixed-size word lists.

Useful? React with 👍 / 👎.

@hulryung
Copy link
Contributor Author

Thanks for the review! I've addressed the feedback in 4b1eca6:

  • korean100: Trimmed from 106 to 100 words
  • korean200: Trimmed from 205 to 200 words
  • IME cursor clamp: Cursor X position is now clamped to the input widget bounds to prevent it from rendering outside the input area in narrow terminals or long inputs

@philocalyst
Copy link
Collaborator

Sloplord satsified, looks swell! @max-niederman

@Craftzman7
Copy link

Sloplord satsified, looks swell! @max-niederman

Hey dude, you've mentioned Max like 10 different times in a single day. Maybe chill out a little?

@philocalyst
Copy link
Collaborator

@Craftzman7 I've been emailing him -- I wanted to review all the active PRs, then the issues. He gave me the go-ahead. I understand this looks spammy from the outside.

@philocalyst
Copy link
Collaborator

Kind of comforting someone cares enough to notice :) You should contribute !!

@max-niederman
Copy link
Owner

Sloplord satsified, looks swell! @max-niederman

Hey dude, you've mentioned Max like 10 different times in a single day. Maybe chill out a little?

lol thanks for the concern, but in this case the pings are appreciated

Add korean100 and korean200 word lists and fix IME cursor positioning
in the input box for proper Korean character composition display.
…cursor

- korean100: 106 → 100 words
- korean200: 205 → 200 words
- Clamp IME cursor X position to input widget bounds
@max-niederman max-niederman merged commit eea6c36 into max-niederman:main Mar 12, 2026
3 checks passed
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.

4 participants