Author Topic: Wrap texts by chars needed  (Read 5504 times)

Offline injuras

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Wrap texts by chars needed
« on: March 29, 2021, 02:43:05 pm »
Some languages, like Japanese and Chinese, do not contain space in text.

Some other languages, like Korean, have very long words.

These characteristics may cause serious problem when the texts written in these languages are very long, especially MODs-related texts. Because it makes so many dead spaces in the letterbox and it shows no newline.

Please see attached images, it contains TWoTS's Japanese text. and X-Piratez's Korean text. Japanese text shows no newline, and Korean text has many dead spaces.
(I don't know how to see the images directly in the post, sorry.)

I think that the problem can be solved to add the option for 'wrap texts by chars'.
('wrap texts by chars' may incorrect or improper terminology, but when i googled to find this problem, someone in Stackoverflow called the problem in this word.)
https://stackoverflow.com/questions/5118367/android-how-to-wrap-text-by-chars-not-by-words/5491268#5491268

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: Wrap texts by chars needed
« Reply #1 on: March 29, 2021, 08:51:19 pm »
Yeah, and scroll for all pedia textboxes =) Russian texts are usually larger than English, so it is hard to translate things when the modder is using all available space for English strings

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3348
    • View Profile
Re: Wrap texts by chars needed
« Reply #2 on: March 29, 2021, 09:20:38 pm »
Another thing could be implement of https://en.wikipedia.org/wiki/Zero-width_space

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Wrap texts by chars needed
« Reply #3 on: April 13, 2021, 09:43:44 am »
I can't reproduce this, we already have wrapping by char for the appropriate languages:

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Wrap texts by chars needed
« Reply #4 on: April 13, 2021, 11:49:55 am »
I can't reproduce this, we already have wrapping by char for the appropriate languages:

User language settings from Options>Video are overwritten by loaded language files of the mod(s).
And if the mod doesn't contain Japanese translations, then the whole game will partially reset to a different language.
You can test it with the attached dummy mod: Dummy.zip

Steps:
1. start OXC, select Japanese in Options>Video
2. enable the Dummy mod
3. check Ufopedia>Airlock

I guess that things like _direction and _wrap should depend only on the user setting, and not be overwritten by Language::load() during mod loading?
« Last Edit: April 13, 2021, 11:59:35 am by Meridian »

Offline injuras

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: Wrap texts by chars needed
« Reply #5 on: April 16, 2021, 06:40:35 pm »
Quote
I can't reproduce this, we already have wrapping by char for the appropriate languages:

How did you do this, SupSuper? Is it a default(hardcoded) setting in OXC that Japanese and Chinese words are wrapped by chars, not words?

In my opinion, wrapping text by char or word may be user's choice, not language-bound.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Wrap texts by chars needed
« Reply #6 on: April 19, 2021, 01:25:33 am »
How did you do this, SupSuper? Is it a default(hardcoded) setting in OXC that Japanese and Chinese words are wrapped by chars, not words?

In my opinion, wrapping text by char or word may be user's choice, not language-bound.
Yes it's language-bound. I can make it user-bound if you want, but I can't imagine it doing anything but make text harder to read.

Offline injuras

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: Wrap texts by chars needed
« Reply #7 on: April 20, 2021, 03:58:00 pm »
Quote
Yes it's language-bound. I can make it user-bound if you want, but I can't imagine it doing anything but make text harder to read.

No, SupSuper. By default, almost all Korean wordprocessors(ie. Hancom hwp, Windows notepad, etc) wrap Korean text by chars.

See the attached image(From Hancom hwp 2007). In blue square, there is setting for wrapping text. Korean(upper one) default is 'by char', English(lower one) default is 'by word'.

I think most Korean read char-wrapped text very well.
« Last Edit: April 20, 2021, 04:04:46 pm by injuras »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Wrap texts by chars needed
« Reply #8 on: April 22, 2021, 06:40:03 pm »
Thanks for the feedback, I fixed the mod issue, changed Korean to wrap-by-char by default and added a user option for it, let me know if this is preferable. :)

Offline injuras

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: Wrap texts by chars needed
« Reply #9 on: April 23, 2021, 05:28:32 pm »
Quote
Thanks for the feedback, I fixed the mod issue, changed Korean to wrap-by-char by default and added a user option for it, let me know if this is preferable. :)

Thank you SupSuper! I heard this from greenscarf(in one of Korean XCOM community). Now Korean words in OXC, OXCE and related MODs use text box more efficiently.

By the way, Finnik says about scroll for text box in this thread. Could you make it for him??

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Wrap texts by chars needed
« Reply #10 on: April 24, 2021, 07:28:23 am »
By the way, Finnik says about scroll for text box in this thread. Could you make it for him??
Done: https://github.com/OpenXcom/OpenXcom/commit/d65d14fad653f314a1dc69d714de250e7d08af82