Arabic Text

Started by student101, Sun 19/06/2022 05:43:54

Previous topic - Next topic

student101

Hi,

I am trying to translate the cat lady game to my language (Arabic). I extracted trs file from tra file and changed some lines but I just got strange symbols in the game instead of Arabic letters. Can anyone help me how to make the game recognize Arabic letters?


Best Regards,

Babar

You would only be able to translate the game into a language that's font is not already included in the game. I doubt that when the game was made, an arabic font was included, so you're not going to be able to translate it into any non-latin language. The only way to do that would be to provide the file you created to the original creators of the game, and hope they include it with an arabic font.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

student101

Thank you for your quick reply. In some games like "Life is strange", there is a way to add Arabic letters to the main font file of the game. I know this game works on Unreal Engine not AGS.  Is it possible to do the same with AGS games? And How?

Crimson Wizard

#3
You can change fonts in AGS game by placing fonts with corresponding names into the game folder. Fonts should be called as agsfnt0.ttf, agsfnt1.ttf and so on (you will have to guess their numbers by experimenting). AGS engine prioritizes files from the disk to ones inside the game (this is how "unofficial" translations were made to AGS games all these years).

But there's more than that. In the past AGS did not support Unicode, so to make it work with language like Arabic you have to use the new 3.6.0 engine from here:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=59842.0

Your TRS files must have a new "Encoding" option in them set as "//#Encoding=UTF-8" at the beginning of TRS file, and saved as UTF-8 without BOM.
More information on TRS options may be found in the AGS manual:
https://adventuregamestudio.github.io/ags-manual/Translations.html#additional-options

TRS should also be compiled with a new tra compiler which understands this option.
We don't distribute this tool here yet, but you may get one here:
https://www.dropbox.com/s/42widlilgfa2aoq/trac%20--%20ags%20translation%20compiler.zip?dl=0

The tool has to be run from command line as: trac.exe <input.trs> <output.tra>

Snarky

It also used to be the case that AGS couldn't handle ligatures (which are apparently necessary to make Arabic look right and not R.E.A.D. L.I.K.E. T.H.I.S.), but perhaps the Unicode support fixed that?

Crimson Wizard

#5
Quote from: Snarky on Sun 19/06/2022 09:11:10
It also used to be the case that AGS couldn't handle ligatures (which are apparently necessary to make Arabic look right and not R.E.A.D. L.I.K.E. T.H.I.S.), but perhaps the Unicode support fixed that?

No, it still cannot, we would have to add different font library for this in the future; and currently it is not know whether we will be able to maintain backward compatibility with this (this may break text looks in previous games), so it was left for the future (or ags4).

I heard that Merhdad was able to achieve acceptable results with Persian language, using some conversion program. I am not completely certain, but  suspect it converts the text, merging letters into complex symbols. That's just a guess though (never tried myself).

student101

Thank you Crimson Wizard for these great information. I will try this method and I will get back to you if I have any problem. Regarding, decompile and recompile trs, I used agstool and it worked well.

student101

Unfortunately, it doesn't work. I got more strange symbols than before. I hope  someone make video tutorial on how to make Arabic language appear in  Ags game because I didn't see any AGS game translated in Arabic.



Best Regards

Crimson Wizard

Quote from: student101 on Mon 20/06/2022 06:39:11
Unfortunately, it doesn't work. I got more strange symbols than before.

You need to clarify exactly what you did, because you could miss some step. What do you have in TRS, and how does it look in game, can you post screenshots?
I did Arabic test in the past, but only as a test to see characters, I don't have actual game now.

* TRS should be saved in a correct encoding (utf-8 without bom)
* TRS should have "\\#Encoding=UTF-8" option set in the header
* TRS should be compiled to TRA using our new tra compiler, because older agstools may not support encoding option (unless their author clearly state that they updated the tool)
* You need a proper Unicode font that has Arabic letters in it placed in the game folder
* Game should be run using the latest 3.6.0 engine

SMF spam blocked by CleanTalk