There is a new version of the forums ready for testing. Please post here if you're willing to help test! We could also use the help of coders!

Author Topic: Arabic Text  (Read 367 times)

Arabic Text
« on: 19 Jun 2022, 05:43 »
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

  • Creator, Mutator and Defecator
    • I can help with proof reading
    • I can help with scripting
    • I can help with story design
    • I can help with translating
    • Babar worked on one or more games that won an AGS Award!
    •  
    • Babar worked on one or more games that was nominated for an AGS Award!
Re: Arabic Text
« Reply #1 on: 19 Jun 2022, 06:43 »
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

Re: Arabic Text
« Reply #2 on: 19 Jun 2022, 07:42 »
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?

Re: Arabic Text
« Reply #3 on: 19 Jun 2022, 08:02 »
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>
« Last Edit: 19 Jun 2022, 08:15 by Crimson Wizard »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Arabic Text
« Reply #4 on: 19 Jun 2022, 09:11 »
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?

Re: Arabic Text
« Reply #5 on: 19 Jun 2022, 09:28 »
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).
« Last Edit: 19 Jun 2022, 09:30 by Crimson Wizard »

Re: Arabic Text
« Reply #6 on: 19 Jun 2022, 09:35 »
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.

Re: Arabic Text
« Reply #7 on: 20 Jun 2022, 06:39 »
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

Re: Arabic Text
« Reply #8 on: 20 Jun 2022, 10:38 »
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