Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: WHAM on Wed 14/03/2012 19:46:24

Title: Translation missing words
Post by: WHAM on Wed 14/03/2012 19:46:24
Hiya everyone!

We're working on translating Big Blue World Domination and there seems to be a problem. While most of the game translates just fine, a few bits just will not take the translation, and I am wondering if this has something to do with how the translations work, as I can't seem to figure it out.

I have checked the .trs file and the original words and phrases are all there, but for example the agent codenames are not translated and neither are the description texts for empty save game slots.

An example:

In a script file "names" i have an array that contains all the codenames, and I have a function that populates this array (NameSetup()) at the start of the game, with names I punched into the source code manually.
Name[0].codename = "Ponch"; Name[1].codename = "Darth"; Name[2].codename = "Ghost"; Name[3].codename = "Icey"; Name[4].codename = "Dualnames";

All the names above appear correctly in the .trs file.

As an agent is assigned a name, the codename is generated like this:

String CodeNameGen() { // Generates a (cool) code name for an agent
  String N;
  N = String.Format("%s-%d", Name[Random(29)].codename,  Random(99));
  return N;
}


However, this apparently does not manage to draw a translated codename, but an untranslated one instead.
Any ideas?
Title: Re: Translation missing words
Post by: on Wed 14/03/2012 20:08:25
I had similar troubles with COTD- even though the translation files were complete, and the trs files compiled without an error, the italian translation skipped parts of a hardcoded "USE a ON b" string to create the GUI text, and the french file skipped a couple of words from character.Say commands. I am still fiddling around to solve that...

You can check, at runtime, if a certain translation file is used. It sounds like a pain in the ass, but you could simply provide translated names in the code, and use them depending on the translation used.
Then again, EVEYBODY uses English codenames these days. Is a translation of those really necessary?
Title: Re: Translation missing words
Post by: WHAM on Wed 14/03/2012 20:37:12
The problem exists on several more areas as well, and due to the state of the code I really don't want to go in and start adding checks for translations in the old code, as it is poorly documented and hastily written. It would take me hours and hours to find all the problem areas in the code, let alone fix everything manually based on the translations. :(
Title: Re: Translation missing words
Post by: Khris on Thu 15/03/2012 00:19:00
Sounds like a perfect job for... http://www.adventuregamestudio.co.uk/manual/GetTranslation.htm
Title: Re: Translation missing words [solved]
Post by: WHAM on Thu 15/03/2012 07:23:31
You make me feel like an idiot again, I recall seeing that in the manual but I thought it was something that just returns the name or ID of the translation that is currently being used or something, and dismissed it.

I just did a quick test to see how this works and I think I can resolve most, if not all, issues using this. It will still take me an hour or two to do it, but that's scripting for you.
Title: Re: Translation missing words
Post by: monkey0506 on Thu 15/03/2012 20:55:16
Quote from: WHAM on Thu 15/03/2012 07:23:31an hour or two to do it, but that's scripting for you.

Nah, scripting for Khris it'd take 5-10 minutes. 8)
Title: Re: Translation missing words
Post by: WHAM on Thu 15/03/2012 21:45:59
Monkey speaks the truth.
I also realized that I can check for the translations as I am initializing the arrays at game start, instead of checking for translations later on when the array contents are called. This way I had to add a check for each entry into the arrays, but due to the fact that the arrays were well organized unlike my other code in this game the job was surprisingly easy.

There are still some oddities that I am investigating, but the function seems to work just right.

As a result: MORE TRANSLATIONS! WOO!