RocketChat / RocketChat/Rocket.Chat
Set 'proper' word breaks for Chinese (and other Asian languages?)
@marceloschmidt is already working on this.
Since May 9, 2017.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
TL;DR - in mobile view, a lot of Chinese text is split across multiple lines and no longer makes sense.
We recently had some custom content translated from English to Chinese, and this incidental note came back from the translators during mobile testing:
NOTE: this is the MESSAGES section of the /account view

CHANGE - All the words circled (and the last section that isn’t circled) have incorrect
word breaks. We have structured the below based on a maximum width of three
characters. If you are able to squeeze 4 or even 5 characters per line then let us
know as the line breaks would be different again.
桌面 / 通知 ("Desktop_Notifications")
通知 / 持续 / 时长
未读 / 报警
使用 / 表情
自动 / 识别 / 文字中 / 的表情 ("Convert_Ascii_Emojis")
自动 / 载入 / 图片
节约 / 移动 / 带宽
关闭 / 默认的 / 嵌入式 / 媒体 ("Collapse_Embedded_Media_By_Default")
Would it make sense for a Chinese-speaking developer to go through the Chinese translation file and insert spaces appropriately, to ensure that text is correctly segmented in mobile view? Or are there reliable word-segmentation packages that could be employed for this purpose?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.