monkeytype
monkeytype copied to clipboard
Adding Korean Language and functionality
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:
- Added Accuracy functionality for Korean
- Added Hangul.js package - package statistics
- Added input visual for Korean input.
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 tohandleChar()
as a rest argument. Needed because it has the untampered Korean input for theresultingWord
. -
handleChar()
has edits with how backspaces are handled
test-ui
:
-
correctSoFar
logic underupdateWordElement()
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
The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2864787498
The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2864802027
The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2865157034
The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2868106109
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.
The PR check action failed. Please review the logs and make the necessary changes. https://github.com/monkeytypegame/monkeytype/actions/runs/2869501157
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:
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?
Exciting pr @neezacoto, ill start testing
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.