how setting languages (countries) into a T3D project

There are no stupid questions, just stupid answers.
28 posts Page 3 of 3
deathbravo
Posts: 49
Joined: Mon Feb 01, 2016 7:06 am
by deathbravo » Tue May 17, 2016 1:36 am
thanks.
It doesn't need to login to see his posts.
irei1as
Posts: 84
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Tue May 17, 2016 11:47 am
Let me confirm that Chinese do work with the c++ change and a localization.
But it needs a bit of more work as arial fails for chinese.

I first added msmincho.ttc (ms mincho, a chinese font, I think) to the font folder in core.
Then I added this new profile:

Code: Select all

singleton GuiControlProfile(GuiTextProfileChi : GuiTextProfile) { fontCharset = "CHINESEBIG5"; category = "Extra"; fontType = "msmincho"; fontSize = 20; };
I made sure this thing is loaded before the exec() of the gui that uses it and after the singleton of GuiTextProfile.

Then in the GuiTextControl I changed the profile to that GuiTextProfileChi.
Also to that GuiTextControl I pointed textID = "line_chinese";
line_chinese is defined in the chinese.txt like:

Code: Select all

_linezero = _ line_chinese = 中國哲學書電子化計劃 line_b = dos line
Then just loaded chinese.txt as I explained in a previous post.
Image

Now, it may be a bit hard to properly switch languages if you need two different profiles.
I guess I could use a common single font with full support for all the languages.
But I think the best method would be to switch profiles in the OnWake callback if the language needs it.
rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue May 17, 2016 2:51 pm
@
User avatar
irei1as
- From your screen shot it looks like you can use both English and Chinese text at the same time. Did you mean mixing languages in the same control? If so, then perhaps an extended MLText control would do the trick - it would have to be extended to add markup for switching fonts mid-sentence and support for using the indicated profile for the contents of the tag. A very interesting idea. I'm (sort of) interested in making a mixed language "game" (actually, an educational game aimed at helping me and others learn Korean) so now that my curiosity is piqued I might just have to start fiddling with this after I finish the stuff I have planned for the RTS Prototype/AI Tutorial.
Dwarf King
Posts: 185
Joined: Thu Feb 05, 2015 7:20 pm
by Dwarf King » Tue May 17, 2016 4:31 pm
Also did you mean to use traditional characters? Because that is what you use right now. Traditional Chinese characters are used on Taiwan and in Hong Kong but not official in mainland China.

China uses the simplified characters. Just to make sure you know that.
rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue May 17, 2016 4:34 pm
Huh, seriously? I thought it was the other way around - something about the mainland Chinese and "maintaining traditional purity" or something.....
Dwarf King
Posts: 185
Joined: Thu Feb 05, 2015 7:20 pm
by Dwarf King » Tue May 17, 2016 4:40 pm
Huh, seriously? I thought it was the other way around - something about the mainland Chinese and "maintaining traditional purity" or something.....
Mao decided to modernize the Chinese language and took like 3-5000 characters and simplified them in order to make it more easy to learn how to read and write for the common man. At least that is what the history books say. When I took my first university degree it was in Chinese language. We even got sent down to Beijing University on a scholarship. We all had to learn simplified characters. That is what you see in the newspapers, tv stations and books in China. The traditional characters are now more used for art and decorations in China.
irei1as
Posts: 84
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Tue May 17, 2016 5:45 pm
@ Dwarf King You're right, my mistake.
I looked for "Chinese text" with google and used the first result but it seems it's a traditional example. Please, excuse my incorrect use.
Msmincho fails with simplified Chinese.

For simplified Chinese it seems SimHei (a microsoft chinese font) works, so use this profile instead of the previous one:

Code: Select all

singleton GuiControlProfile(GuiTextProfileChi : GuiTextProfile) { fontCharset = "CHINESEBIG5"; category = "Extra"; fontType = "SimHei"; fontSize = 20; };
Image


@ rlranft Sadly default extended MLText lacks the localization part of TextCtrl (well, I can't find the textID part, correct me if I'm wrong) so from stock we can't use the localization .txt and the profile changing.
But the profile changing is more of a graphics thing of the font. You can see in the image how "This is English" has a weird font (that's the SimHei English) quite different from the Arial from the "Singleplayer".
It's not much of an issue if you're ok of how it looks.
rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Wed May 18, 2016 1:27 am
@rlranft Sadly default extended MLText lacks the localization part of TextCtrl (well, I can't find the textID part, correct me if I'm wrong) so from stock we can't use the localization .txt and the profile changing.
Well, that's exactly my point - My approach would be to derive a new object from MLText and add markup tags to allow you to switch text profiles (like you already can choose colors, for example) in mid-sentence even. Not exactly a simple project, but I might tinker with it later this summer.
28 posts Page 3 of 3

Who is online

Users browsing this forum: No registered users and 6 guests