CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
228 stars 91 forks source link

Question in Chinese localization. #45

Open Sewens opened 7 years ago

Sewens commented 7 years ago

Greetings, I'm a MO gamer in china.I'm trying to translation this DTAclient into Chinese version. I try to compile a .SpriteFont file with Chinese characters. But there still remains some problems.

qq 20170220092612

qq 20170220091508

I replace SpriteFont1.xnb in MO 3.3's Resources folder, and it's works a little. From the pic above u can see, some text textures' font in UI have been changed,and other Chinese characters in list box, check box, etc. still have some problem. Some characters were replaced by question mark.

qq 20170220092556

Also, I try to chat in Chinese in multiplayer mode, still there are some characters remain in question mark.

qq 20170220095813

And here's my speculation:

  1. IT IS the default font this project use that cause the question mark issue. For example suppose we use font "Times New Romans" as client default font, when we type in Chinese character client could find only small part of these Font and others become question mark.
  2. Only small part of text textures use SpriteFont files, and it helps a little in online chat and Chinese localization.
  3. WOULD YOU KIND create an INI interface from which players can change the default font that client use.So that it will be easier for players around the world to trans this client into their language version.

Besides, someone has done translation successful by decompiling some files. Here's the pic: 81588218367adab4f566e4e682d4b31c8601e4a7

3a5769224f4a20a48e76e46399529822730ed0e8

And link: 百度贴吧

Rampastring commented 7 years ago

Question marks appear in place of every character that doesn't exist in the SpriteFont.

Only small part of text textures use SpriteFont files, and it helps a little in online chat and Chinese localization.

All text textures use the SpriteFont files.

WOULD YOU KIND create an INI interface from which players can change the default font that client use.So that it will be easier for players around the world to trans this client into their language version.

I don't want to have different SpriteFont files for players from different countries. It'd result in some people seeing question marks in place of other players' chat.

However, I'd gladly use a font in the client that includes all necessary Chinese characters, but I haven't been able to figure out a way to generate such a huge SpriteFont. Before the client's public release I tried to generate a SpriteFont that included thousands of Chinese characters, but my PC couldn't generate the spritefont even when I gave it 48 hours of time for it.

If you can get in touch with the person who managed to translate those mission briefings into Chinese with properly working symbols and ask them how they managed to generate the SpriteFont files, I'd gladly add support for Chinese symbols to the default spritefont files.

I could also code a stringtable feature that'd make translation easy with no INI editing needed.

Sewens commented 7 years ago

In fact, I've create a spriteFont file that include the most recently used Chinese character(about 8k character). But I've no idea which SpirteFont.xnb file should replace, so I replaced SpriteFont2.xnb and u can see that result, there still be question mark issue, nothing happend.

There's no necessary compile all these Chinese character, so I create a SpriteFont that incude 8k mostly used character. AND I've generate some spriteFont files included necessary Chinese character, so would you pls help me to test it? I can help u to generate spritefont file.

Here's my some xnb files and SpriteFont file. https://github.com/Sewens/CNCClientLocalization

And I've contact with him, I'm waiting for his reply now.

Rampastring commented 7 years ago

Thanks, I'll try to generate a font based on your .spritefont description file when I have the time for it.

The client uses multiple spritefonts depending on the UI control. If I remember correct, Mental Omega uses SpriteFont1.xnb for most of its UI. If you want to be sure, you can try replacing all of the font files with your custom font.

Sewens commented 7 years ago

Greetings, I've finish generate different font type .xnb files which successfully trans client into chinese. Here's some pic: _20170222192720 _20170222192757 Most of these texts in campaign and skirmish are translate into Chinese, I've try different font type then found the font "等线" really good.

_20170222193015 Then character in online chat preform normal.

One last problem, I notice that some texts in settings are static code in MainExecute programe, I communicate with that guy who translate client completely, he says he has re-edit the client code to change these text into Chinese. I know there's some ini file like GameOptions.ini which control some pic's location, would you pls write these UI text into INI file so that we can translate it easier? _20170222192814 Besides I've update my github, here's all xnb files available. https://github.com/Sewens/CNCClientLocalization/tree/master/%E5%90%88%E9%80%82%E7%9A%84%E5%AD%97%E4%BD%93

Rampastring commented 7 years ago

Regular Latin characters look bad with that font. Ideally I'd want to generate a font that has both good looking Latin characters and good looking Chinese symbols.

One last problem, I notice that some texts in settings are static code in MainExecute programe, I communicate with that guy who translate client completely, he says he has re-edit the client code to change these text into Chinese. I know there's some ini file like GameOptions.ini which control some pic's location, would you pls write these UI text into INI file so that we can translate it easier?

I'll probably write a stringtable feature later on (when I have the time for it) that'll make translating these possible. That's also generally a better way to translate everything, instead of editing the core INI files. It might take some months though.

(Of course, if someone with skill in C# wants to contribute and write the stringtable feature sooner, feel free to; if the code in the pull request is decent, I can merge the changes to the master branch.)

Sewens commented 7 years ago

Greetings there's another problem I wanna solve.

Regular Latin characters look bad with that font. Ideally I'd want to generate a font that has both good looking Latin characters and good looking Chinese symbols. I try 2 keep original files from MO replace only one spritefont file 4 localization so that these EN character will look good with Chinese character support.

I noticed that there are 6 files in MO's Resources folder. When I replaced SpriteFont0.xnb with my own file. Everything performs well, inner fonts have been replaced by my settings. BUT EN characters become weired.

Then I delete all of SpriteFont files except one that I created. Client has crashed when I re-enter my game. _20170305221733 There's fist crash window. Then I restore some of them(file 0,1,2), unfortunately another index of range crash happened. _20170305222525

I found codes in Render part use a loop to read these spriteFont files, then I really DONT know why index out of range occur. especially when I restore file 0,1,2,3 then everything become normal. tim 20170306085938

So I wanna know what's these files' loading order when program initialize, can I compile EN & CN characters in individual files and what are their loading orders?

I've try replace spriteFont0.xnb with my NO-EN_CHAR-File then client crash and told me missing EN char. I restore all of them then replace spritefont1.xnb, client still crash.

I just want's 2 create different character files use different font. From example EN use Times New Romans in the first file, then Simplified Chinese char in 宋体 in the second, Traditional Chinese in the third file, if Japanese char needs support we can also generate individual file for him. SO,pls help.

Rampastring commented 7 years ago

So I wanna know what's these files' loading order when program initialize, can I compile EN & CN characters in individual files and what are their loading orders?

Currently the UI code in my controls (labels, textboxes, listboxes etc.) does not allow using multiple fonts in a single item.

The client has been coded to use fonts between 0 and 3. If you remove any of those font files, it'll crash.

I've try replace spriteFont0.xnb with my NO-EN_CHAR-File then client crash and told me missing EN char.

Add this XML code to your .spritefont file:

    <!--
    If you uncomment this line, the default character will be substituted if you draw
    or measure text that contains characters which were not included in the font.
    -->
    <DefaultCharacter>?</DefaultCharacter> 
Sewens commented 7 years ago

Greetings, there's another questions. Current client version does not support IME, by which we input none-english characters. Would you support it in the future?

Rampastring commented 7 years ago

I don't currently have plans for that. I have no experience with supporting IME.

Sewens commented 7 years ago

Thanks, I will try to handle this (perhaps I would learn basic C#

Rampastring commented 7 years ago

It's not an easy task for a beginner, in addition to handling the IME-related Windows APIs you'd need to write UI code for it. But good luck, and if you manage to implement it, make a pull request and I'll gladly include the code in the client :)

woodee commented 3 years ago

Regular Latin characters look bad with that font. Ideally I'd want to generate a font that has both good looking Latin characters and good looking Chinese symbols.

One last problem, I notice that some texts in settings are static code in MainExecute programe, I communicate with that guy who translate client completely, he says he has re-edit the client code to change these text into Chinese. I know there's some ini file like GameOptions.ini which control some pic's location, would you pls write these UI text into INI file so that we can translate it easier?

I'll probably write a stringtable feature later on (when I have the time for it) that'll make translating these possible. That's also generally a better way to translate everything, instead of editing the core INI files. It might take some months though.

(Of course, if someone with skill in C# wants to contribute and write the stringtable feature sooner, feel free to; if the code in the pull request is decent, I can merge the changes to the master branch.)

It's 2021 now,have the stringtable feature done yet? Hope to see it.

Metadorius commented 3 years ago

No, it's not done. I have a prototype but it's in the works as it requires changes to UI library the client uses, and we didn't come to an agreement on the matter yet.

285984303 commented 1 year ago

I can already input Chinese, but I cannot log in with a Chinese name yet