Opened 21 years ago

Closed 21 years ago

#784 closed defect (fixed)

DIG: Garbage text in Spanish version

Reported by: SF/mykself Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: The Dig

Description

Version: ScummVM 0.4.1cvs Built on May 19 2003 15:52:37

Bug: I'm using spanish version of The Dig. Only the text has been translated. The text at the intro of the game shows OK (except some wrap-around problems), but after that, all the text goes crazy. The status window of ScummVM shows no error, but the text are not AT ALL correct (see picture). For the non-english talkers, game is unplayable. I've tested two different copies of The Dig (mine is first spanish edition, the other from a reedition), to the same resuls. Even try "-qes" command line switch, but that doesn't works.

Language: Spanish Version: PC Plataform: Win32

Ticket imported from: #739799. Ticket imported from: bugs/784.

Attachments (1)

ErrorDig02.jpg (48.2 KB ) - added by SF/mykself 21 years ago.
Picture of garbage text (32k jpeg)

Download all attachments as: .zip

Change History (15)

by SF/mykself, 21 years ago

Attachment: ErrorDig02.jpg added

Picture of garbage text (32k jpeg)

comment:1 by SF/mykself, 21 years ago

Summary: Garbage text in Spanish versionDIG: Garbage text in Spanish version

comment:2 by SF/mykself, 21 years ago

Priority: normalhigh

comment:3 by fingolfin, 21 years ago

Please do not change the priority of items. The team does that by itself. This bug is not highly critical by itself, as it can be cirumvented (by deleting the spanish localisation files).

comment:4 by fingolfin, 21 years ago

Priority: highnormal

comment:5 by SF/mykself, 21 years ago

Sorry for the change of priority... It will never happen again :)

There are other solution (reading the forum sometimes help :) ) The localization file LANGUAGE.BND, where the translated text resides, is XORed with a 0x13 value, maybe to avoid spoilers, maybe to hide an not-so-well transation. That's the problem with the garbled text.

I have a unXORed version of the file and I'm doing a little program to unXOR any LANGUAGE.BND (provided the XOR value, of course)... It's good to post the file here? Or, in doing that, I'm breaking some copyright or something else?

In any way... Can't we program the -q<lang> switch to inform ScummVM that he must unXOR the text, only on The Dig?

comment:6 by SF/khalek, 21 years ago

scummvm actually checks for this, from line 909 of string.cpp

// determine is file encoded if (buf[pos] == 'e') { enc = 0x13; pos += 3; } else { enc = 0; } This was obviously added for spanish version...

comment:7 by fingolfin, 21 years ago

Hm, so why does it not work for Javier then?

comment:8 by SF/mykself, 21 years ago

Hmmm... I'm taking a look at the CVS source... It seems that, as khalak says, there are a method (Scumm::translateText) that, among other things, looks for the encoded text and unXOR it before return it to the parser (at 16 different places)... maybe I'm wrong, but I think the method do it the wrong way... It looks:

// determine is file encoded if (buf[pos] == 'e') { enc = 0x13; pos += 3; } else { enc = 0; }

but pos==0 when that happens!! And buf[pos]=='!', as the first character at LANGUAGE.BND, spanish version, is a ''. The 'e' flag of the encoded text is at pos==3... Mmmm... testing... . . . YES! It goes perfectly... I've added that:

// determine is file encoded >>>pos += 3 //skipping LANGUAGE.BND head "! +LF+CR"
if (buf[pos] == 'e') { enc = 0x13; pos += 3; } else { enc = 0; }

It seems that now it works with the spanish file... but I think there may exist files in other languages that must we try...

comment:9 by fingolfin, 21 years ago

Closed bug report #744452 as a duplicate of this.

comment:10 by SF/giovannibajo, 21 years ago

I have verified that the italian version of DIG suffers from exactly the same problem. The first line of the file simply contains "!\r\n", while the second line contains "e\r\n".

I think the code should be updated to skip the optional first line (no clue what it means).

The xor key is the same, 0x13.

Actually, why doesn't the whole translateText() work on a line- by-line basis?

comment:11 by SF/giovannibajo, 21 years ago

A little update.

I decrypted my own language.bnd with a small script (also removing the "e" line from it). Now the text is visible but there are other little problems. For instance, the sentence "Use % ___ with %___" (italian version) behaves exactly like it was written "Use%___%___" (note no spaces). And if you move the mouse over the other guys on the first scene you can't see their names. I have no idea what it is going on, the sentences look correct within the translation file.

I can upload the script somewhere if anybody is interested in trying it.

comment:12 by fingolfin, 21 years ago

I would code a proper fix for this, but I don't have a non-english Dig to test this. Maybe somebody could send me a language.bnd file (compressed, and to my SF.net address: fingolfin@users.sourceforge.net).

comment:13 by fingolfin, 21 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:14 by fingolfin, 21 years ago

I fixed this yesterday (rewrote the code that does the localizations for The Dig, actually, it's much cleaner now and even has comments *gasp* :-)

Note: See TracTickets for help on using tickets.