• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

[HELP] how to Translate GOF ?

DarkSlimus

Powder Monkey
Hi,

I start a new topic, so alls of us can participate in and we found the good way for multilanguage support

You need to translate:

- Nearly all or all the ".h" files in the Program\Text subdirs.

- Every ".txt" file in RESOURCE\INI\texts\russian, including the questbook subdir.

- The RESOURCE\INI\texts\russian\common.INI file.

- May be some other INI, h or txt files I'm not aware of.

- A bunch of ".C" files, scattered all around where the modders (including myself) used in-line strings without any care for the (unpalatable) localization strategy Akella implemented in the game.

Only the three first points amount for hundreds of files and thousands of lines, and any little mistake in the files structure will bring the game down or, at least, broke the involved dialogs or screens.

The ".txt" files in RESOURCE\INI\texts\russian are especially tricky: they have translatable text and non-translatable label names, you need to get the handle on them or you are risking a lot of errors:

BasicDefense {Basic Defensive Arts}
perkBasicDefense {
Received damage decreases by 10%.
}

Add to the mix that you are translating to french, where phrases tend to be longer than in english: you are going to run out of space lotsa times, which calls for a deep context knowledge to choice the right wording.

And you are going to expend the rest of your life trying to cope with modders adding string on top of strings on top of strings, some (most?) times in-line in the C sources :d:.

If you have not a solid experience localizing software and a sizable knowldge of the game itself it is going to be a real hell for you (a fearsome lot of work anyway).

Best of luck for you!
buho (A).

so I try to start a personal translation (just because it's better for me to have one language in use and not some dialogues who start in french and continue in english ...

I'm not sure to make a complete translation of it, but I'm ready to do my best according to my time and motivation.

my first try start with a bug ... oh nice I'm in the good way ! here is what I do:
in RESOURCE\INI\texts\ folder
  • create a french folder and copy all files and subfolder of russian folder
  • modify language.ini file like that
Code:
[COMMON]
defaultLanguage	= french
;defaultLanguage	= russian
;defaultLanguage	= french
;defaultLanguage	= german
;defaultLanguage	= spanish
;defaultLanguage	= italian

I noticed two bugs after this change
1 - the start screen show nothing

2 - I'm unable to show the principal menu with F1 key or Echap ... it just make a pause, if i press two times F1 its come back to the game so I suppose it's can't find the french menu but the game don't freeze !

according to this two issues I suppose that change language.ini file is the good way but perhaps another .ini file manage the language
another way is to translate directly in the russian folder, but if I make a good translation and want to send it to the modders I think is better to have a real multilanguage system and not just a barbarian method of translation... In the same way perhaps in the future modders can make language files for all strings can be translated ...

now I've a question for you burho. in your example my logic want I translate the blue part, right or not?
BasicDefense {Basic Defensive Arts}
perkBasicDefense {
Received damage decreases by 10%.
}

and to finish with the first post I want to say that I'm not a codder but I know some base in C/C++/Python (I'm 2D graphic designer) and I already do some mods translation for other game.
 
Having independent language files are, of course, the better way generally speaking... but I'm not sure if it is the better way for COAS.

First lets take into account that not all the game is coded in the open C-scripts source files we can see and change, a good part of the game is compiled in DLLs or the EXE file and we have not access to the source code. Very important parts are in the DLLs/EXE.

The localization system is based on aliases, lookup routines and content files, look at this code:

Code:
worldMap.date.monthnames.m11 = XI_ConvertString("target_month_11");

"target_month_11" is an alias. The XI_ConvertString routine will lookup the content somewhere and return the translation; actually the content is in RESOURCE\INI\russian\commmon.ini:

Code:
string = target_month_11,"November"

XI_ConvertString is a "native" function; it is not coded in the C-script files but implemented in the DLLs/EXE. We have not access to the code, we don't know how it works.

Now lets think about how the modders work: modders adds code in the C files and strings in the related content files (sometimes :d:). Modders can not add strings in every language file because usually we don't speak every tongue out there. Even for a modder speaking, say, two or three tongues, it is not sure he having the will to update three different sets of language files. The official team, as an example, probably will add the english strings and nothing more.

Now we have a mod with labels which have related content only in the english language files. What is going to happen when said mod is run in a spanish or french environment which have not the related content?

I can't say because I don't know how XI_ConvertString works.

May be he have a "fallback" and, after seeing the french (or spanish) string is not there he will "fallback" to the english one. Or may be he will return an empty string. Or may be he will abort the execution of the involved code. (My bet is for the last two possibilities: returning an empty string is the easy way and aborting code execution is a strategy widely used in COAS).

The "barbaric method" (and I totally agree with the concept) is less stressing: when installing the new mod the french player overwrites some of his files and reverts to a game with a lot of parts in english again, but the game is still playable. The translators can take his time to translate and add the new strings.

Now, it is your call. I'm not trying to tell you what to do, only producing some food for thought.

Cheers.
buho (A).
 
First lets take into account that not all the game is coded in the open C-scripts source files we can see and change, a good part of the game is compiled in DLLs or the EXE file and we have not access to the source code. Very important parts are in the DLLs/EXE.

I thought that there was access to the source code :mm

or have I misunderstood the meaning of these threads ---- >>>

http://forum.piratesahoy.net/index.php/topic/15184-we-have-the-storm-engine/page__view__findpost__p__354004

& http://forum.piratesahoy.net/index.php/topic/16966-age-of-pirates-ii-piratesahoy-edition/page__view__findpost__p__384744


or do you mean something different. :shrug
 
Buho,

I'm agree with you, COAS isn't thought for multilanguage. When you install it, you choose a language but you don't have a specific language folder or something else ... It's a choice of development so we must do with that.

in this case I begin with the barbaric method, in the russian folder ... anyway I've already copied the files in the french folder and just wait if we found a solution in a more or less near future.
 
First lets take into account that not all the game is coded in the open C-scripts source files we can see and change, a good part of the game is compiled in DLLs or the EXE file and we have not access to the source code. Very important parts are in the DLLs/EXE.

I thought that there was access to the source code :mm

or have I misunderstood the meaning of these threads ---- >>>

http://forum.piratesahoy.net/index.php/topic/15184-we-have-the-storm-engine/page__view__findpost__p__354004

& http://forum.piratesahoy.net/index.php/topic/16966-age-of-pirates-ii-piratesahoy-edition/page__view__findpost__p__384744


or do you mean something different. :shrug

Access to the sources is restricted, and for what I know (I have not access) they are not the complete sources so I have no idea about what is there and what is not there.

Cheers.
buho (A).
 
Buho,

I'm agree with you, COAS isn't thought for multilanguage.

Actually it is pretty confusing.

You have things like this:
Code:
#include "TEXT\DIALOGS\Common_Portman.h"
which is basically carved in stone.


But you have too things like:
Code:
NPChar.FileDialog2 = "DIALOGS\" + LanguageGetLanguage() + "\Tavern\" + NPChar.City + "_Waitress.c";
which appears te be part of a multilanguage system.

Now, what is most confusing is:

a) Common_Portman.h is a content file. It have only translatable strings. But he is #included with a hardcoded path.

b) xxx_Waitress.c is a code file. It have nothing to translate (it is only code). But the path is parametrized. On top of that, the file have a harcoded #include pointing to a content file (#include "TEXT\DIALOGS\Tavern\xxx_Waitress.h").

It makes very little sense. It is like Akella started a multilanguage system but never ended it. That or the engine is tweaking the #includes on the fly (technically possible but very convoluted).

Well... Akella coding design is very convoluted.

Cheers.
buho (A).
 
Wouldn't it be simpler to just translate the English to French in this case rather than try to create multi-language support?
 
Wouldn't it be simpler to just translate the English to French in this case rather than try to create multi-language support?

I think that is what Slimus is bearing to right now.

But it is going to be and insane amount of work anyway.

Cheers.
buho (A).
 
I think that is what Slimus is bearing to right now.

It's what I do now ... It's work fine but I start to translate slowly ;)
Actually I've acquired the game one month ago and install GOF this week. so I play and translate when I need. actualy I just translate quest I've in my log book, it work fine, but sometimes english word stay cause of the @<city> (or something like that) I suppose with time it will be all in french, but not sure a lot of french players play at this game because you can just buy it on net ... well, perhaps I must creat a WIP topic and find another french player ready to translate some files.

buho is right: do this alone would be a very long job ... another version of GOF would be made before I end this translation !!!

EDIT: Incredible !! I find someone who make all the translation in french. just the books aren't translated, but I send him a message and we can finish that soon.
 
Back
Top