turn off space wrap on chinese

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

turn off space wrap on chinese

Post by 473BFF6D »

TL;DR: space wrap not suitable for chinese.

Chinese normally [do not have spaces] and [wrapped char by char]. Current space wrap cleaves the sentence causing bad display when there are format spaces like the one between chinese and numbers and latin letters, between text and reference.

The following image shows a sentence cutted on " T ".
Image
An ideal display will be like this (without space wrap):
Image
(Chinese text: ζŒ‰ T ζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚
Correspond english text in game: Press T to start a new research.
Direct translation: Press T to open science technology panel to start new science technologies' research and development.)

As I know, japanese have no spaces as well.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: turn off space wrap on chinese

Post by eradicator »

+1
473BFF6D wrote: ↑Thu Feb 25, 2021 8:33 am As I know, japanese have no spaces as well.
Correct. Though at least your example works fine:
ttoresearch.png
ttoresearch.png (4.53 KiB) Viewed 5906 times
Looking at core.cfg i think this might be considered a translation bug? The chinese translation actually has two spaces while the japanese one has none. Though i have to admit that a single half-width letter looks ugly when pressed against full-width japanese text without space. And the lack of space(ing) in the japense locale is probably just a hackfix for exactly this even more ugly wrapping issue.

Code: Select all

not-researching=ζŒ‰ __CONTROL__open-technology-gui__ ζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚

Code: Select all

not-researching=__CONTROL__open-technology-gui__γ‚’ζŠΌγ—γ¦γ€ζ–°γ—γ„η ”η©Άγ‚’ι–‹ε§‹γ—γΎγ—γ‚‡γ†οΌ
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: turn off space wrap on chinese

Post by eradicator »

On further thought + testing this can be solved by using non-breaking space in the chinese core.cfg:

Code: Select all

not-researching=ζŒ‰Β __CONTROL__open-technology-gui__Β ζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: turn off space wrap on chinese

Post by eradicator »

On further thought + testing this can be solved by using non-breaking space in the chinese core.cfg:

Code: Select all

not-researching=ζŒ‰Β __CONTROL__open-technology-gui__Β ζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚
Edit 1: Hrng! Looks like the forum softeware replaces non-breaking spaces with normal ones so i can't actually post that correctly.

Edit 2: I made a quick demo mod
er-chinese-non-break-demo_0.0.1.zip
(1.23 KiB) Downloaded 124 times

Edit 3: @moderation This thus may or may not have to be moved to the translation forum?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

Yes, NBSP, the most semantic correct solution. Hard to apply myself though.
I will go to translation forum to request a QA, just leave this post here.

Hopefully, a specify line breaking rule could be applied in game, not default english wrap-on-space and explicit NBSP.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: turn off space wrap on chinese

Post by eradicator »

473BFF6D wrote: ↑Fri Feb 26, 2021 3:59 am Yes, NBSP, the most semantic correct solution. Hard to apply myself though.
I will go to translation forum to request a QA, just leave this post here.
As far as i understand everybody can contribute on the crowdin translation project. Not sure how the proof readers react to "invisible" changes. But the people in the translation forum will know more.
473BFF6D wrote: ↑Fri Feb 26, 2021 3:59 am Hopefully, a specify line breaking rule could be applied in game, not default english wrap-on-space and explicit NBSP.
Yea, fixing the default wouldn't hurt i guess.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
wjy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jan 12, 2019 6:48 am
Contact:

Re: turn off space wrap on chinese

Post by wjy »

Traditional Chinese (zh-tw) also suffers from this issue. The tech button is fine because of the short text, but the issue still occurs on another instance.
The tech button in zh-tw
The tech button in zh-tw
Screenshot_20210226_162610.png (9.2 KiB) Viewed 5795 times
Graphics settings in zh-tw
Graphics settings in zh-tw
Screenshot_20210226_163011.png (127.33 KiB) Viewed 5795 times
There are at least two ways to solve the issue. The first is to let Factorio developers implement line breaking rules according to a valid standard, and the second way is using special characters like NBSP to manually control the line breakings. I considered that the second way is a workaround because it's not perfect.

The zh-tw community members had discussed about whether to put spaces between Chinese and Latin texts. There are no clear conclusions because of the text displaying limits.

I am afraid that Factorio developers are not going to implement the rules because of the complexity.

I have notified the Simplified Chinese proofreader of this post. And thanks @473BFF6D for triggering a notification to me. I had subscribed the translation forum only.

Edit: Removed the link to Line Breaking Rules because it seems not directly related to this topic.
Last edited by wjy on Sun Feb 28, 2021 3:02 pm, edited 1 time in total.
Traditional Chinese proofreader of Factorio.
Crowdin profile: https://crowdin.com/profile/willy04wu69
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

I just tried no space, SP, NBSP, ZWSP, ENSP, ZWJ, "", β€œβ€, they all cause wrap !?
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

I have heard factorio is written wth Allegro whose source code shows line breaks only appear on SP and tab which do not respect almost any of the Unicode Annex #14 who indicates line breaking algorithm including ones of ideographics and punctuations. But my test result above just confused me.
User avatar
wjy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jan 12, 2019 6:48 am
Contact:

Re: turn off space wrap on chinese

Post by wjy »

473BFF6D wrote: ↑Fri Feb 26, 2021 12:13 pm I just tried no space, SP, NBSP, ZWSP, ENSP, ZWJ, "", β€œβ€, they all cause wrap !?
I tested with NBSP and got a good result. Don't know how did you try it? When I trying to type a NBSP I found that if you copy NBSP from a web page, the NBSP will be converted to a normal space character.
Graphics settings in zh-tw. The space after "16" was changed to a NBSP.
Graphics settings in zh-tw. The space after "16" was changed to a NBSP.
Screenshot_20210227_000907.png (101.01 KiB) Viewed 5741 times
Traditional Chinese proofreader of Factorio.
Crowdin profile: https://crowdin.com/profile/willy04wu69
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

Maybe the key reference equals to a space.

And I got this on my computer!
Image

Full color setting in zh_TW looks well on my computer.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: turn off space wrap on chinese

Post by eradicator »

473BFF6D wrote: ↑Sat Feb 27, 2021 3:27 am And I got this on my computer!
Image
Interesting and definetly broken. Also assuming that is from 1.1.25 and knowing that my screenshot is from 1.0.0, that means something changed, and like it looks not just the font/layout. Maybe someone changed the locale to break "conveniently" in the new layout.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
wjy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jan 12, 2019 6:48 am
Contact:

Re: turn off space wrap on chinese

Post by wjy »

473BFF6D wrote: ↑Sat Feb 27, 2021 3:27 am Full color setting in zh_TW looks well on my computer.
I'm curious about what did you see. Could you please share the screenshot?
eradicator wrote: ↑Sat Feb 27, 2021 6:15 am Interesting and definetly broken. Also assuming that is from 1.1.25 and knowing that my screenshot is from 1.0.0, that means something changed, and like it looks not just the font/layout. Maybe someone changed the locale to break "conveniently" in the new layout.
According to the Crowdin activity history, someone added "\n" to the translation to force a line wrapping.
https://crowdin.com/project/factorio/ac ... on_id=7752
Traditional Chinese proofreader of Factorio.
Crowdin profile: https://crowdin.com/profile/willy04wu69
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

wjy wrote: ↑Sat Feb 27, 2021 6:39 am I'm curious about what did you see. Could you please share the screenshot?
The NBSP behavior is just the same as yours.
User avatar
wjy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jan 12, 2019 6:48 am
Contact:

Re: turn off space wrap on chinese

Post by wjy »

473BFF6D wrote: ↑Fri Feb 26, 2021 12:13 pm I just tried no space, SP, NBSP, ZWSP, ENSP, ZWJ, "", β€œβ€, they all cause wrap !?
Here I assumed that you were out of luck from trying using NBSP.
473BFF6D wrote: ↑Sun Feb 28, 2021 2:12 am The NBSP behavior is just the same as yours.
Here I assumed that you were successfully using NBSP. It's confusing to me and I'm not sure which one did you mean. I posted two screenshots before. The first one for using normal space after "16" and the second one for using NBSP after "16."

Image
Image

BTW, using NBSP or using no spaces is a double-edged sword.

I tested another configuration and found another issue when using NBSP or using no spaces. Given the following example translation:

Code: Select all

δΎ‹ζ–‡ε­—16δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—OpenGL例文字例文字。
The example would be displayed in the game as:

Code: Select all

δΎ‹ζ–‡ε­—16δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—δΎ‹ζ–‡ε­—Ope
nGL例文字例文字。
So, using NBSP or using no spaces could (still) lead to:
  1. Break a English word in default configs.
  2. Break a English word when using a different UI scale.
  3. Break a English word when a player modded the font of the game.
  4. Break a English word when the translation included a variable and changed the length dynamically.
Traditional Chinese proofreader of Factorio.
Crowdin profile: https://crowdin.com/profile/willy04wu69
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

wjy wrote: ↑Sun Feb 28, 2021 3:45 pm Here I assumed that you were out of luck from trying using NBSP.
No, I confirm they're all correctly inputed. My editor can show the code point under the caret.
Please try that translation under zh_CN. The colored T key may be a line breaking point.
wjy wrote: ↑Sun Feb 28, 2021 3:45 pm It's confusing to me and I'm not sure which one did you mean.
"NBSP behavior" just means when NBSP is used.
User avatar
wjy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jan 12, 2019 6:48 am
Contact:

Re: turn off space wrap on chinese

Post by wjy »

473BFF6D wrote: ↑Mon Mar 01, 2021 2:35 am No, I confirm they're all correctly inputed. My editor can show the code point under the caret.
Please try that translation under zh_CN. The colored T key may be a line breaking point.
Thanks for clarifying. I am surprised that we were talking about two different issues:
  1. Formatted text (the colored "T" key) is like having spaces after it and behaving as a line breaking point.
  2. Current line breaking rules is not ideal for CJK (Chinese/Japanese/Korean) text and often lead to break a line at a improper position.
For the first issue, the following two examples express the difference:

Code: Select all

not-researching=ζŒ‰__CONTROL__open-technology-gui__ζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚
The result of above translation. Tested in zh-cn.
The result of above translation. Tested in zh-cn.
Screenshot_20210301_104759.png (4.92 KiB) Viewed 5595 times

Code: Select all

not-researching=ζŒ‰Tζ‰“εΌ€η§‘ζŠ€ι’ζΏεΌ€ε§‹ζ–°η§‘ζŠ€ηš„η ”ε‘γ€‚
The result of above translation. Tested in zh-cn.
The result of above translation. Tested in zh-cn.
Screenshot_20210301_104529.png (4.82 KiB) Viewed 5595 times
The formatted one seems to have a line breaking point and the line breaking point is included in variable __CONTROL__open-technology-gui__ . The variable is not controllable by translators.

For the second issue, the first line in the tooltip is improperly broke after "16." Thus a large blank is left after the first line.
Image
Traditional Chinese proofreader of Factorio.
Crowdin profile: https://crowdin.com/profile/willy04wu69
473BFF6D
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 25, 2021 7:40 am
Contact:

Re: turn off space wrap on chinese

Post by 473BFF6D »

Well, break point at key belongs to non-ideal CJK line beraking, I think. It just causes NBSP fix won't work.
Post Reply

Return to β€œIdeas and Suggestions”