Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Khris on Sat 10/02/2007 16:25:08

Title: Strange translation behavior
Post by: Khris on Sat 10/02/2007 16:25:08
The problem is solved already, but I've encountered a strange behavior while dealing with it and I'm curious what could be the reason for this:

I've added the translated words and stuff to a translation source file.
The GUI and shortcut keys are translated like this:
...
JjNn
YyNn
a_button_give 5 802 803 Dd
0 1 2 Gg
a_button_pick_up 2 800 801 Ee
1 7 8 Pp
...

(No "a_button_x" stuff in the translation is the correct way to do it, btw.)
When I tested the translation, neither pressing "y" worked nor were the GUI buttons display correctly.
I've contacted the game's author and he sent me his version of the translation. The above part of the txt-file looked *exactly* the same, I've double-checked this, and with his version, the GUI buttons DID work, but pressing "y" still didn't. (I've added Display commands to debug and the GUI stuff was translated but "JjNn" wasn't.)

In a desperate attempt to solve this, I recreated the translation source and pasted over the text. First everything before the above, then the above piece, then everything after it. So once again, I had two txt-files looking *exactly the same*.
I then created a compiled translation from the new source, and suddenly everything worked fine!

I don't get it. Any enlightenment is appreciated.
Title: Re: Strange translation behavior
Post by: Kweepa on Sat 10/02/2007 17:47:04
Perhaps there were non-printing characters, or there was a CR/LF difference.
Title: Re: Strange translation behavior
Post by: Akatosh on Sat 10/02/2007 18:03:28
Hm... no idea if that's possible, but the y/z problem seems too typical...

Do you and the author happen to use two different keyboard layouts (german QWERTZ and american QWERTY)?
Title: Re: Strange translation behavior
Post by: Khris on Sat 10/02/2007 18:20:39
Steve: I've checked the translation that didn't work and there's the usual "0D 0A" behind every line in question. No leading spaces or at the end, too.

Akatosh: That's the first thing I thought of ;) But no, I tried both y and z and neither worked.
Title: Re: Strange translation behavior
Post by: Pumaman on Sun 11/02/2007 00:53:44
I don't really understand the question. In what context are you using these translation lines? Are they part of a Display() command or are you using GetTranslation() to process them manually? Basically, what's all this about?
Title: Re: Strange translation behavior
Post by: Khris on Sun 11/02/2007 15:04:15
All these lines are used in a function called AdjustLanguage() which assigns keycodes  for keyboard shortcuts and sets the actions and sprites for the main GUI buttons. The lines end up as parameters of GetTranslation().

And this thread is about the fact that creating a compiled translation from text file A doesn't work while creating it from text file B *does*, although A=B. I was just looking for an explanation, that's all.
Title: Re: Strange translation behavior
Post by: Scorpiorus on Sun 11/02/2007 16:54:30
Quote from: KhrisMUC on Sun 11/02/2007 15:04:15
And this thread is about the fact that creating a compiled translation from text file A doesn't work while creating it from text file B *does*, although A=B.

Hmm, I'd recommend to binary-compare them if you haven't done it yet.

For example, Windows has a FC command to do that:

FC /B FileName1 FileName2

Just in case...