Author Topic: [fixed] Line wrapping does not work for Chinese  (Read 1084 times)

james876

  • Guest
[fixed] Line wrapping does not work for Chinese
« on: 15 September 2011, 07:51:30 »
Today, I translated the file: advanced_tutorial_english.lng.
 I have to translate it into Chinese, but found a problem: the text does not wrap.
 Chinese font can not be the same as the English word wrap.(Can not be multi-line display)

 BTW:Save the file encoding utf-8
« Last Edit: 15 September 2011, 07:57:56 by james876 »

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Chinese font can not be the same as the English word wrap.
« Reply #1 on: 15 September 2011, 10:50:00 »
Please confirm: you say that (1) you need to use wrapping so that the text will fit and (2) you can not use \n for line wrapping. Do you need column wrapping instead of line wrapping?

I know there are several ways to write chinese, but I do not know how chinese is properly written on a computer. Do you write in columns or lines? Do you write from the right to the left or from the left to the right? Please explain.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Chinese font can not be the same as the English word wrap.
« Reply #2 on: 15 September 2011, 17:17:21 »
As tomreyn has mentioned, if you language text is long (as shown in the screenshot) add \n to the places in the text where you want to force a newline.

Thanks

james876

  • Guest
Re: Chinese font can not be the same as the English word wrap.
« Reply #3 on: 16 September 2011, 00:44:52 »
I use Notepad to write, writing format is written from left to right, thank you!

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Chinese font can not be the same as the English word wrap.
« Reply #4 on: 16 September 2011, 00:50:40 »
I am repeating what softcoder said: Use this to add artificial line wrapping: \n

Example:
Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing elit.

This will look like this:
Quote
Lorem ipsum
dolor sit amet,
consectetur
adipiscing elit.

[small]Edit: Yeay, I found the 'toggle view' option to disable the silly text formatting.[/small]
« Last Edit: 16 September 2011, 11:23:02 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

james876

  • Guest
Re: Chinese font can not be the same as the English word wrap.
« Reply #5 on: 16 September 2011, 01:16:03 »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Chinese font can not be the same as the English word wrap.
« Reply #6 on: 16 September 2011, 10:59:35 »
\n
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Chinese font can not be the same as the English word wrap.
« Reply #7 on: 16 September 2011, 16:11:43 »
Fixed in svn for scenario lng files

james876

  • Guest
Re: Chinese font can not be the same as the English word wrap.
« Reply #8 on: 17 September 2011, 03:32:01 »
Today, I tested the svn-2544, discovered the problem still exists, the text does not wrap.
 

BTW: I tested the chat feature, still did not support Simplified Chinese chat and my operating system is: windows7 32bit, I use the input method is: Chinese (Simplified) - Microsoft Pinyin input method.
 Thank you!

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Chinese font can not be the same as the English word wrap.
« Reply #9 on: 17 September 2011, 03:49:57 »
I don't see you using \n in your screenshot, the text does not automatically wrap. Regarding Chinese text in the ingame chat, it worked perfect for me in Linux using the latest svn, I'll try it in windows next.

james876

  • Guest
Re: [fixed] Line wrapping does not work for Chinese
« Reply #10 on: 18 September 2011, 04:07:12 »
I am waiting for the game to chat with Chinese input method function, thank you!