Languages ???

Karam

Chieftain
Joined
Oct 1, 2005
Messages
92
Hi there, I was wondering if it's possible to add right to left languages in civ4, in this case Arabic. Is this another SDK mystery? seems that XML doesn't accept any right to left languages, except English characters.

Any ideas here? all help appreciated:)
 
It's quite possible, Karam. I'm not sure about technical issues of translation, but there are Russian and Polish translations made by fans. You need some code translator (?) to convert text files for editing in arabic and then for converting them back to civ format.
 
Rabbit Alex, I am considering it.

NeverMind, I can translate Arabic, my computer does support the language, but my problem is that when I type things in Arabic in XML, the characters do not appear.

any ideas?

EDIT: I meant I can't save the characters in XML.
 
No, it isn't working. I have attached what it looked like, the characters in strange shapes. I think it goes back to the font, any ideas? I can't seem to edit the font.
 

Attachments

  • 1.gif
    1.gif
    14.8 KB · Views: 160
Try use number of letters in unicode - if it won't crash the game it will work fine - some problems could be also with font sylfaen.ttf - try what will do deleting it...

HTML:
In english is:
This world isn't big enough for the two of us!
and in polish:
Ten & # 1 5 6 ;wiat jest dla obu naszych cywilizacji zbyt ma & # 179 ; y! (type "& # 1 5 6 ;" and "& # 179 ; y!" without spaces)
and in the game with polish replacing french
Ten Świat jest dla obu naszych cywilizacji zbyt mały!
i don't know how you gonna see it on your computers - but believe me - there are polish letters :) correctly dispalyed

I've tried different combination with numbers
& # 179 ; - could be also dispalyed in different letters coding for example as %#453;  in mentioned before unicode (i'm shooting because i don't remember other numbers for other letter coding, you should google for specific letters' numbers). But there is possiblity to crash the game when you do something wrong. Try different combinations... I can't help you much because i only work with polonization of mod

I've added sample xml file (note: save it as .xml)
 

Attachments

Asioasioasio, how do I translate them into unicode letters? the problem is I've tried some other unicodes, but without success, the letters keep appearing in this manner.

I can't figure out how to change the font....
 
Hi ! i don't know if this can help you .But perhaps changing 'CvUtil.py' :

Code:
def convertToUnicode(s):
	"if the string is non unicode, convert it to unicode by decoding it using 8859-1, latin_1"
	if (isinstance(s, str)):
		return s.decode("latin_1")
	return s
	
def convertToStr(s):
	"if the string is unicode, convert it to str by encoding it using 8859-1, latin_1"
	if (isinstance(s, unicode)):
		return s.encode("latin_1")
	return s

I know this function is used for full of descripton ... but i've also seen other python file that used encode("latin_1") dy default .Can that perhaps help you?
 
Sto, I guess there is some hope in this sector, I tried but it didn't work, any ideas what other files concern this??? Thankyou in advance
 
Karam, I'm not sure, but I've got a friend who told me that he added similar languages by changing the font.

The question is does anyone know how to change the font of the game? you'll need someone to answer you, I guess ColdFever is the answer, didn't he try to in CivScale?
 
try to delete sylfaen.ttf in Windows\Fonts\ (of course make backup)
letters in game will change to arial - i'm not shure if it's unicode arial
 
Once again.... It didn't work :(... Any ideas? can it be because of python??
 
I looked around and found out how to change fonts.

In Resource\Themes\Civ4\Civ4Theme_Common.thm (which is just a pure text file) from line 373 to 396, they define the four font "sizes" that the game resources use. These Size1-4 are assigned actual font names here. For example

GFont .Size0_Normal = GFont("Sylfaen", "Regular", 10, GFlags(GFontFeature, GFC_FONT_ALPHA));

Simply change these twenty occurrances to any font name that is registered with Windows would do. For example changing "Sylfaen" to "Arial".

But this doesn't really solve the language problem. I'm at a loss at how to get Civ4 to display text in the system's default language encoding. On my machine (Chinese Traditional, encoding is called Big5) I can change these font assignments to use the system default font, which has the Chinese characters. But I cannot get Civ4 to display the Chinese characters I put in the XML files, they come out garbled as before. Even with this right font, the Chinese for "am" and "pm" in the clock is also garbled like before.

It seems it doesn't matter what gets in, Civ4 prints out only latin1 encoded strings?
 
I had studied this topic before v1.52, and I found someone had got result as below:
1. All characters of a language can be displayed in civ4 if that language uses 1 byte code. Part of characyers of a language can be displayed in civ4 if that language uses 2 byes code.

2. The characters in civ4 are displayed in two method, they use different font.
One is in files GameFont.tga and GameFont_75.tga of folder C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\res\Fonts, they are used in main graphics screen.
Another is in file sylfaen.ttf of folder C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Resource\Fonts, they are used for menu and so on.

3. To show your own characters in graphics screen, You have to create your own GameFont.tga and GameFont_75 with Gimp. You can only use about 700 characters in this file. Here is a sample of GameFont.tga for Chinese.

4. To display your characters for menu text, you have to create a ttf font file with truetype font editor, then change font in file Civ4Theme_Common.thm as above. Remember you only can use code lower 255 or 0xFF, so that about 200 characyers, here is a sample of Chinese TTF font file.

5. Change XML file to charset for your language and use &#nnnn to specific character for your language.
 

Attachments

  • GameFont.tga.jpg
    GameFont.tga.jpg
    209.4 KB · Views: 84
  • new.ttf.jpg
    new.ttf.jpg
    119.1 KB · Views: 89
  • CiV4GameText_New.xml.jpg
    CiV4GameText_New.xml.jpg
    142.3 KB · Views: 112
I was actually aware of attempts using what you described (for simplified Chinese) to produce a more or less Chinese version of the game. On the other hand, I have also heard of a supposed Japanese version, to be launched some time this year, and had hoped that they would fix these display problems by then, allowing us to actually use unicode characters with an Unicode TTF. (Incidentally, it seems certain that there would be no traditional Chinese version, so no hope there.)

Is it certain that they do not plan to fix this display problem? I've been putting off translation in the hope that 1.61 would fix things up, but things don't look good here. I'm a translator but no programmer nor hacker.

From my tests, I'm sure in-game text all use the TTF, not just menu text, though. This is why I'm still hanging onto some hope that perhaps it's the python parts or some core display function not playing nice. But I don't have the know-how nor the time to hack into Civ4 for this.
 
mnf said:
From my tests, I'm sure in-game text all use the TTF, not just menu text, though. This is why I'm still hanging onto some hope that perhaps it's the python parts or some core display function not playing nice. But I don't have the know-how nor the time to hack into Civ4 for this.
You are wrong, because I have used a part Chinese version, a lot of characters inside game, for example, when I move mouse to a button of buttom center, the description text in Chinese characters will be displayed on screen, such text are in GameFont.tga file. Then menu text, like "Load Game" will use characters in ttf font file specified in Civ4Theme_Common.thm file.

Unzip files as below, then put *.tga files to folder
~\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\res\fonts

put *.xml files to folder
~\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\xml\text

Restart civ4, you will see some Chinese on game screen, but you still use default ttf font file!
 

Attachments

Hey thanks there guys! I didn't realize that my thread was once again alive!

Mikezang, I applause your research, however, I don't get how the game understands the characters you type in the GameFont_75.tga file, edited by GIMP.

And one thing: Did you get the game to work in Traditional Chinese Characters???

What I now need to know, is what I need to edit after coding the Arabic characters in order to get them to appear in the game...
By the way, what font editing program did you use? ;)

Thanks, I await your answers
 
Karam said:
Mikezang, I applause your research, however, I don't get how the game understands the characters you type in the GameFont_75.tga file, edited by GIMP.

And one thing: Did you get the game to work in Traditional Chinese Characters???
In fact, here character in tga file is a image not a real character, you can copy Traditional Chinese to the same position inside tga file, so that you can view them in game. But I didn't try it, because this way only support limit Chinese characters, I wonder to show all Chinese characters.

Karam said:
What I now need to know, is what I need to edit after coding the Arabic characters in order to get them to appear in the game...
By the way, what font editing program did you use? ;)
Can you tell me what is charset name of Arabic characters? and how many letters about Arabic characters? I think it is more easier than DBCS (Chinese, Japanese) and maybe I can help you for it if Arabic characters only use SBCS (Single Byte Character System).
 
Back
Top Bottom