Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: hexaae on 12 Feb 2018, 11:33

Title: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 12 Feb 2018, 11:33
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&t=13316 (http://forum.xentax.com/viewtopic.php?f=33&t=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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Danvzare on 12 Feb 2018, 12:17
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
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 12 Feb 2018, 13:54
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.

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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 12 Feb 2018, 14:38
"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! :-[
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 12 Feb 2018, 14:58
"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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 12 Feb 2018, 15:05
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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 12 Feb 2018, 15:24
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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 12 Feb 2018, 15:31
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.


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.


Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 12 Feb 2018, 15:42
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).
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 12 Feb 2018, 15:53
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...
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Danvzare on 13 Feb 2018, 11:52
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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 03 Mar 2018, 11:21
News? :(
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Crimson Wizard on 03 Mar 2018, 12:04
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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: hexaae on 03 Mar 2018, 22:27
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)

(https://image.ibb.co/bvKacn/image.png) (https://ibb.co/eGwcq7)

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 - "àƒ™"

Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: LotBlind on 29 Aug 2019, 21:38
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.
Title: Re: Maniac Mansion Deluxe - improved translation, need help to re-build TRA files
Post by: Jibun on 24 May 2020, 19:02
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 (https://github.com/Jibun/ags-translation-editor)
You can find and download the windows executable in the release tab of the repo.