Translation Tool

Déja

Beyond the Mod
Joined
Dec 19, 2005
Messages
353
Just for fun (and because I want to ultimately make an Esperanto translation for Civ4), I've developed a tool to make it much easier to translate the text files.

Here's the good stuff:
- Cycles through an XML file <text> by <text> allowing you to view an original language (English default) and the new translated version
- Features a Mod Patch feature to let you quickly add everything you need to an existing mod (or even your CustomAssets folder). After patching, your new language will be added to any existing languages, the UI updated to feature your language in the options menu, and "dummy" entries for all texts will be created (defaulting to English)

Now for the bad news...

I was lazy and used C#, and since I'm working away from home and work, I'm using VC# 2005 Express which means that you'll need to have the .NET 2.0 Framework in order to use this.

Additionally, I was also lazy and didn't do much by way of error handling. It won't cause any damage to your XML, but you may end up with an unhandled exception, if I missed something.

That said, here are a few screenshots, and the program. The first is the main window (set to English->Esperanto), The second is the Patch Mod window, the third is the options screen from a post-patch mod and the fourth is a shot of the civilopedia after setting the language to Esperanto.



ONE FINAL WARNING!
This doesn't just apply to this program, but keep in mind that if you have additional languages in a mod and you use one of them, when you open the regular-non-modded-game it will still be looking for that 9th or 10th language and, not finding it, it'll not display any text. If this happens, just go to your Civ Config INI file and set the Language to 0 or whatever you normally use.


Enjoy!

-Déja
 

Attachments

  • CivIVTrans.zip
    CivIVTrans.zip
    29.1 KB · Views: 475
  • screen1.gif
    screen1.gif
    17.2 KB · Views: 494
  • screen2.gif
    screen2.gif
    10.8 KB · Views: 433
  • screen3.gif
    screen3.gif
    12.5 KB · Views: 447
  • screen4.gif
    screen4.gif
    50.2 KB · Views: 468
As long as they're within the ASCII range (i.e. they're within the first 256 characters of the font set) they'll display fine. Civ4 doesn't support unicode, so languages which use Kana/Kanji or any of the non-western-european characters (such as the c-circumflex in Esperanto) will have to wait a while. Those letters, though, are supported.
 
Are you sure? The &#somenumber; form in which you need to enter the special characters follows the Unicode standard.

I didn't test the tool yet, looking forward to it when I install NET framework 2.0 (I only have 1.1)
 
I've tried. It may be a font limitation, but when you use anything above &#255; it just displays a box
 
Well, as I had previuosly written in another topic, the reason why the characters are not displayed outside the 256 ASCII table is that the XML head tag uses the ISO-8859-1 encoding. My first attempt was to change it to the wider UTF-8, because it seemed a logical solution, but in that case the program abrupted while loaded in with an XML parsing error.

So it looks for me that unfortunately the coders of the program did not tink it over thoroughly the possibilities of the XML and the possible modding demands.
I am not a programmer, but it seems to me, that the XML / Python "surface" for the modding should be capable to handle any language add-ons or changes, but there are other, hidden restraints somewhere in the code (probably in dll-s), which do not allow that.

Anyhow, thank you very much Déja for your work, I have a 65% ready Hungarian add-on translation which I have abandoned when only the squares appeared, now I will try to finish it!
 
Judging from their addition of the Russian, Japanese and Chinese languages, they will have to be working on unicode otherwise those languages cannot be implemented. So there's hope for the future.
 
I can look into it, but you can download .NET 2.0 from microsoft.com.
 
bad news... it's going to be 2.0 only until I at least get back to campus later this month. Even then, I'll only port it down to 1.x if it doesn't require modification of the code, because it's not really worth my time to downgrade it, at this point.
 
Thx a lot, it's very useful for help mod creators ^^
EDIT: (BUG) When a new file is loaded upon the first, this crash
(FEATURE REQUEST) I wish go to the end of the document with a button because of some files of 1700 entries..
 
yeah, I'm planning to work on it more over the next couple of weeks. I wrote that in a few hours, so I didn't expect it to be bug free. Thanks for telling me, though.
 
Déja said:
Just for fun (and because I want to ultimately make an Esperanto translation for Civ4), I've developed a tool to make it much easier to translate the text files.

That would be useful, but I would like if there were more lines visible.

However, I am used and I will use txt-editor :-)

I programmed a small php-program which adds custom language and remove other languages, and also one to use with a collaborative translation project:
Image1.png
 
Back
Top Bottom