How correctly translate the game?

All Hi!
I’m not native English speker and my game need translate on both languages by default.
I’ve read documentation and saw “Guide: Localization”, but i don’t understand how it work on practice.
I’ve saw couple games other developers with many languages in their games
and i saw type of translations like <<if $language = 'EN'>> [English text of the passage]<<elseif $language = 'ES'>>[Spanish text of the passage].
How i will do this correctly? Please, write any practice examples.

1 Like

Hi there! There are a few ways of doing it:

  • Use TME’s Localization code (it’s JavaScript with a setting that you need to edit a bit)
  • Use conditional statements (like your example)

I personally use the first option in my games (See this source code as example - playable here.

I also have a whole chapter on localization in my SugarCube guide.

2 Likes

Hi, there!
Do you think that this will support all languages, including Greek?
Thank you!

The code will fit whatever language you want to add (as long as it is supported by the used device), even if it only shows French, English and German in the example. You just need to edit it to fit it how you want it.

There have been many official localization, which do not use the basic Latin characters, like Arabic, Chinese (unsure which one), Russian and Turkish. If you end up translating the whole list of elements for localization, you may want to send them down the line to TME/TheMadExile, so he can add it for other users :slight_smile: