Maniac Mansion Deluxe - improved translation, need help to re-build TRA files

Started by hexaae, Mon 12/02/2018 11:33:52

Previous topic - Next topic

hexaae

Can someone help me with Maniac Mansion Deluxe (re)translation?
I've found an unofficial tool on the net: forum.xentax.com/viewtopic.php?f=33=13316, to convert TRS <-> TRA but has some problems with special chars (e.g. à èìòù) that will be incorrectly compiled into final Italian.tra file, e.g. "àˆ così" becomes "ï¿à• cosï¿à•".
I tried to save the Italian.trs in Windows 1252, 1250, ANSI, UTF but the problem was still there.

I don't know AGS unfortunately :(, so I wondered if someone can help me to recompile just the new Italian.trs correctly into Italian.tra, with special char support.

Danvzare

Unfortunately I can't help you with your translation problems (although considering the source code is available, maybe the problem could be fixed internally).

But I am very grateful for you posting this. I've been searching for a tool like that for years!
So thank you so very much for showing me this tool. :-D

Crimson Wizard

Quote from: hexaae on Mon 12/02/2018 11:33:52problems with special chars (e.g. à èìòù) that will be incorrectly compiled into final Italian.tra file, e.g. "àˆ così" becomes "ï¿à• cosï¿à•".
I tried to save the Italian.trs in Windows 1252, 1250, ANSI, UTF but the problem was still there.

The thing is that you do not only have to save the text in correct ANSI codepage for italian language, but you also need to supply game font which corresponds to that ANSI codepage.
This is how unofficial translators do, - they have to supply both the translation and the font.
Font can be TTF of WFN, I guess TTF will be much easier to find. It must NOT be a Unicode font, but ANSI Italian font. Just put it in the game's folder.

hexaae

"D:\RetroGames\MMC\DATA\Menu1.ttf" is actually std Arial TTF opentype font, and as far I can understand it does support all codesets (the game can be played with special char fonts also in French, Deutsch, Russian etc.)...
I think the problem is with the tool TRA recompile, not sure HOW does it converts ANSI special chars internally.
Other ideas on how to recompile the TRA with special chars, starting from a revised Italian.trs (ANSI)? :(

P.S.
Unfortunately I've never used AGS, so I may be wrong and didn't understand something, so please explain me everything in detail! Thanks a lot! :-[

Crimson Wizard

Quote from: hexaae on Mon 12/02/2018 14:38:13
"D:\RetroGames\MMC\DATA\Menu1.ttf" is actually std Arial TTF opentype font, and as far I can understand it does support all codesets (the game can be played with special char fonts also in French, Deutsch, Russian etc.)...

When you say "the game can be played in French, Russian etc", do you mean that you've actually seen these characters in the game, or you only think that will happen?
The problem is that AGS is not a Unicode program, it can use only characters in codes from 0 to 255. For that reason it cannot fully use the font that supports all codesets.

I never used that TRA/TRS converter myself, so don't know what it does.

E: Well, to be honest, I also don't know Italian language, so IDK if it even requires special codepage and font. Maybe standard Latin font should be enough.

Crimson Wizard

Sorry, I could have been confused myself.
An important question I have is, why do you convert the text to UTF8? Or does this tool convert it to UTF8? AGS won't be able to read UTF8 format.

EDIT: I checked the source code of the program, it looks like it is using UTF7 and UTF8 encodings to read and write the translations... Unless I misunderstand something, I am not sure how that is even supposed to work with AGS.

I guess some testing and research is required first.

hexaae

Yes, the game already displays French, Russian, etc. special chars correctly when you change language...

I tried to save the Italian.trs as UTF-8 and UTF-7, but the game still uses wrong chars. I think the problem is with TRS -> TRA recompile/conversion (i.e. a problem with the unofficial conversion tool), not with the Italian.trs file itself and its codeset :(

Are the sources of this game available (where)? I could try recompiling it from scratch...
I've sent some PM to original author of Maniac Mansion Deluxe but still got no reply. I hope he can help me.

Crimson Wizard

Quote from: hexaae on Mon 12/02/2018 15:24:29
Yes, the game already displays French, Russian, etc. special chars correctly when you change language...
It probably uses compatible fonts for each translation. My point was that it won't be able to do so using the single font you mentioned.


Quote from: hexaae on Mon 12/02/2018 15:24:29
I tried to save the Italian.trs as UTF-8 and UTF-7, but the game still uses wrong chars. I think the problem is with TRS -> TRA recompile/conversion (i.e. a problem with the unofficial conversion tool), not with the Italian.trs file itself and its codeset :(

The point is that AGS CANNOT use UTF, it just cannot! Because it expects all text in ANSI.
From the looks of its source code, the conversion tool also saves files in UTF, which may be the cause of the problem. But this needs investigation.



Crimson Wizard

Forgive me, looks like I myself completely misunderstood what you were saying.

You mean that you tried saving TRS in UTF in attempt to make the conversion tool work correctly, since it is conversion tool that takes TRS and writes new TRA file.

Sorry, I will try to check how this tool works when I find free time, since its source code is open (https://bitbucket.org/Taktloss/ags_translationeditor).

hexaae

Thank you for taking care! Would be great an updated version of that very useful tool more "compatible" with AGS and its ANSI restrictions :-D
Would make translators' life much easier and open up the possibility of translating many other AGS games for all the easy way...

Danvzare

I just want to add to this discussion.
I've tried using the tool, and it seems as though it has problems with all special characters, even if those special characters are on the non-translated lines.

Because if you try to translate a line with a special character on it, the special character(s) gets messed up and the game does not recognise the line, and therefore doesn't translate it.

So the problem is definitely in the way the program is converting it to a .TRA file.


Crimson Wizard

Well, I was planning to look into this on weekends, but then got busy on previous weekends with something else and forgot.

Try this: https://www.dropbox.com/s/zumhd381xopdmh1/AGS_TranslationEditor--tryfixutf8.zip?dl=0

I literally changed 3 lines in the program to make it save TRA in current ANSI codepage instead of UTF8.
The result will depend on your system local settings, but in theory it should work same as if you were working with AGS Editor.

Probably for better experience the program needs a ANSI page selection in the window.


Did program author reply to you, by the way? I could send a patch suggestion to him if he's still active.
Although something I don't like about this program is how it is installed.

PS. it would also may be a good idea to write standalone utilities run from command line which would do this job to extract strings from the game into TRS, and create TRA from TRS, so that they don't depend on GUI.

hexaae

WOW!!
It seems to work fine: I've saved the .TRS as UTF-8* with Notepad2, loaded it through your new version of the tool, exported as .TRA and BAHM! Everything worked as expected! (nod)



I can now release a revised Italian translation for this great remake! :D
Great work! Thank you so much!
This will open a new chapter in AGS localizations...

P.S.
No, I'm not in touch with the original author but in the first forum I've found the tool, he said was totally open to any improvement from other users, so...

* UTF-8 (ITA special chars)

+ à  - \u00e0 - "àÆ' " [%C3%A0]
+ è - \u00e8 - "àÆ'¨"
+ é - \u00e9 - "àÆ'©"
+ ì - \u00ec - "àÆ'¬"
+ ò - \u00f2 - "àÆ'²"
+ ù - \u00f9 - "àÆ'¹"


+ àâ,¬ - \u00c0 - "àÆ'â,¬"
+ àˆ - \u00c8 - "àÆ'ˆ"
+ É - \u00c9 - "àÆ'‰"
+ àÅ' - \u00cc - "àÆ'Š’"
+ à’ - \u00d2 - "àÆ''"
+ àâ,,¢ - \u00d9 - "àÆ'â,,¢"


LotBlind

Anyone have any idea if there's some way to type everything in normally (with special characters), then mass replace them with what the program is expecting?

EDIT: Okay, I get it. The .TRS files are plain text. You can just open them in some text editor and replace everything there. Cool! Leaving this here in case someone benefits from this.

Jibun

AGS Translation Editor v2.0.0 available!

It's been some time, but I have continued the project and done several changes to it.
Special characters are now loaded and saved as expected and I have added some extra functionalities and fixed other minor bugs.

Here is the repository of the project: https://github.com/Jibun/ags-translation-editor
You can find and download the windows executable in the release tab of the repo.

SMF spam blocked by CleanTalk