mojira.dev
MC-198700

Line breaking rules of non-Latin characters

The Bug

Minecraft tries to insert line breaks at whitespaces for long sentences, making it produce awkward layouts for languages that don't use spaces as the word delimiter like Chinese and Japanese.

This article by 3TUSK does an excellent job at explaining and code analyzing the bug and provides potential fixes to the issue.

Original Description

At line breaking rules for not European characters in any version of Minecraft, it is not perform completly.

So I can only menthon Japanese rule because I'm Japanese, these characters must not come at the beginning of lines:

And, maybe only Japanese language, "Full-width" characer will not ruled general line breaking rule.

The issue of line breaking rules can be menthoned in other languages, for examples Chinese(zh_ch, zh_tw).

P.S. Possibly this issue is easy to appear in languages that not use (half-width) space.

[media]


ja_jp - "。" comes at the beginning of a line in Advancement description.

[media]


ja-jp - "。" and "、" comes at the beginning of a line in Realm introduction.

[media]


zh-tw - "。" comes at the beginning of a line in Distortion effects description.

Linked issues

Attachments

Comments 5

As a Chinese user I can confirm this bug. It seems that the algorithm makes new line using rules in English only.

There is someone analyzed this bug in depth and made a Forge mod to patch up. He uses the Java class java.text.BreakIterator which is said to be better than the vanilla implementation.

https://github.com/3TUSK/PanI18n/blob/bleeding/docs/line_break/func_78271_c-en_us.markdown

Plus, the vanilla algorithm cannot break English word in the middle, such as

Super-
market.

hello, to report Language issue, go to Crowdin Project

@@unknown No, it is related to how the code handles long text, rather than how the text is translated. The same bug happens when you write non-European text in a book.

Please do not change the value of category, as it's mainly meant to be set by developers. Thanks 🙂

⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

karakufire

(Unassigned)

Confirmed

Platform

Normal

Internationalisation

1.16.2, 1.16.4, 20w51a, 1.16.5, 1.17, ..., 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4

Retrieved