monkeytype icon indicating copy to clipboard operation
monkeytype copied to clipboard

Adding Korean Language and functionality

Open neezacoto opened this issue 1 year ago • 6 comments

Description

Draft pr for words: adding korean to languages #3413

  • Added Korean language: Korean (500), Korean 1k, Korean 4k (4201). Based off the most commonly used words in Korean via this list

Features:

With Hangul.js each word was disassembled into its components and was checked with the input char.

Hangul.disassemble('가나다'); // ['ㄱ','ㅏ','ㄴ','ㅏ','ㄷ','ㅏ']

This required edits in: input-controller:

  • isCharCorrect()
  • A reference to the Korean visual div
  • How input is taken in in$("#wordsInput").on("input"... and now passing the realInput to handleChar() as a rest argument. Needed because it has the untampered Korean input for the resultingWord.
  • handleChar() has edits with how backspaces are handled

test-ui:

  • correctSoFar logic under updateWordElement()

test.html:

  • added a div for the korean char visual as well as some styling

test-logic:

  • logic to turn off and on/refresh the Korean visualizer (hidden by default).

out-of-focus:

  • added the Korean text visual to the blur class toggle

korean

neezacoto avatar Aug 16 '22 01:08 neezacoto

The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2864787498

github-actions[bot] avatar Aug 16 '22 02:08 github-actions[bot]

The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2864802027

github-actions[bot] avatar Aug 16 '22 02:08 github-actions[bot]

The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2865157034

github-actions[bot] avatar Aug 16 '22 04:08 github-actions[bot]

The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2868106109

github-actions[bot] avatar Aug 16 '22 13:08 github-actions[bot]

It would be easy for us developers to review the code if you split the pr into two. One for functionality and the other for words.

rizwanmustafa avatar Aug 16 '22 15:08 rizwanmustafa

The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2869501157

github-actions[bot] avatar Aug 16 '22 16:08 github-actions[bot]

Added !(isLangKorean && !correctSoFar) to dead key if statement. This is so that when typing, it will show you immediately if you typed a Korean character sequence wrong, instead of telling you after you've completed the character.

Example without fix: Word: 하나 Input: ㅇ Result: dead key highlight Expected: error highlight

Fix: update

neezacoto avatar Aug 18 '22 18:08 neezacoto

It would be easy for us developers to review the code if you split the pr into two. One for functionality and the other for words.

Why? How the heck do you want to test the functionality of a language without the words?

Miodec avatar Aug 22 '22 10:08 Miodec

Exciting pr @neezacoto, ill start testing

Miodec avatar Aug 22 '22 10:08 Miodec

It would be easy for us developers to review the code if you split the pr into two. One for functionality and the other for words.

Why? How the heck do you want to test the functionality of a language without the words?

Never thought about this part.

rizwanmustafa avatar Aug 22 '22 11:08 rizwanmustafa