3 ms·
Unfortunately this (and linked) article only represents Japanese issues. If you blindly apply these suggestions Chinese or Korean users may have issues. I'll li
by lifthrasiir 5y ago
Unfortunately this (and linked) article only represents Japanese issues. If you blindly apply these suggestions Chinese or Korean users may have issues. I'll list Korean issues below primarily because I'm Korean, but you may want to interview actual CJK users (one of each, not a single user) for testing.
> Line breaking rules
This should link to W3C Requirements for CJK Text Layout [1]. The Wikipedia article alone doesn't fully describe the complexity of CJK typography.
CJK languages are common in that they all have classes of punctuations that can't be separated by a newline. But there is one more thing to consider for Korean: both word-based breaking and character-based breaking is possible depending on the context. The general rule is to use word-based breaking for larger texts and character-based breaking for smaller texts, but there is no clear threshold so you really want to consult Korean users for testing.
[1] https://www.w3.org/TR/clreq/ https://www.w3.org/TR/clreq/ (Chinese), https://www.w3.org/TR/jlreq/ https://www.w3.org/TR/jlreq/ (Japanese), https://www.w3.org/TR/klreq/ https://www.w3.org/TR/klreq/ (Korean)
> Messaging Apps: Do not directly hook to the Enter key to submit messages
This advice is also problematic. In pretty much all Japanese and most Chinese IMEs they should go through candidate windows so pressing Enter should not submit messages, but in some Chinese and virtually all Korean IMEs there is no automatic candidate window and pressing Enter should submit messages.
In the ideal world detecting a newline as suggested by the article should have solved this issue, but that got complicated by clueless pan-CJK IME implementations. They generally assume candidate windows even for Korean, so they do not commit texts on Enter and that's very inconvenient for Korean users. Therefore it is rather recommended to detect a newline by default, but also have an option to submit messages on Enter.
- needle0 5y agoI updated both sections according to your suggestions. Thanks!
- needle0 5y agoWas notified from someone else about the isComposing attribute -- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve... At least for web stuff, do you think checking for this before treating the Enter key as Submit would work in both IMEs with and without input buffers?
- lifthrasiir 5y agoThe problem is that those clueless IMEs do intercept the Enter key contrary to user expectation, so I think you can't distinguish those IMEs from Chinese and Japanese IMEs that should intercept the Enter key as expected.