GameMaker Studio 2 - Localization Tutorial (Avoid Wasting Months of Work)
Thomas Gervraud
Translation script: https://pastebin.pl/view/4578b4c3 Font Drop: https://fontdrop.info/ My game on Localizor: https://www.localizor.com/space-gladiators-escaping-tartarus
š© Get my private emails: https://thomasgervraud.com/newsletter š® Buy Space Gladiators: https://store.steampowered.com/app/1144910/ š„ Buy Lost Potato: https://store.steampowered.com/app/1365010/ š¤ Twitter: https://twitter.com/ThomasGervraud
When I started out making my first game, I was writing all of my texts directly within my code. Maybe you're doing the same thing and honestly... that's a mistake. You'll waste a huge amount of time later on when you want to translate your game to other languages. You'll have to track down all of your texts and write code to change it depending on the language selected by your player and that'll just be very VERY annoying to fix.
Fortunately, there's a better and simpler way to do it. You can spend a few minutes right now setting up your project the right way and you'll save potentially months of effort down the line.
THE SOLUTION
What you want to do is to have all of the text that will need to be translated later on inside of external files. Those files will be in either .csv or .json format and they'll be easily tweakable using other tools like Google sheets or Localizor. I personally use .csv files.
Then inside of your codebase you'll have keys that reference the actual text contained in those files. For example, you'll have a key like item_sword in your code where you want to display the name of your sword item, and in your external file you'll have the actual text which is "Sword". You can have one file for each language that you're translating to or just one big file with one column for each language if you don't have too much text.
3 TIPS
- Replace numbers in your translations by symbols like {a} or {0} that you'll be able to replace in your code with the actual values. This way you won't have to change the value for every language you support every time you need to tweak the balance of your game and you won't have duplicate entries in your localization file.
- Don't concatenate strings inside of your code like this. In some languages the order of the words is different than in English so just put the whole text inside of your localization file.
- You'll need to add new ranges of characters inside of your fonts for some languages (like French) if you want the special characters to be displayed correctly. Also, you should check that your font supports the characters you'll need before choosing it by using a tool like FontDrop. You'll most likely need another font for Asian languages like Chinese, Japanese and Korean and you'll need to switch between the fonts depending on your current locale. ... https://www.youtube.com/watch?v=HYPYowI4PK0
40754848 Bytes