Design Different approaches to implement a globalization system?

R

RGiskardR

Guest
Hi everyone,

I hope you're all feeling good.

I'm tryng to develop a system to let the player change the language of the game. I don't have a lot of experience with GML so that's why I'm asking for your help.

My idea is something like:
  • Store all the texts on an external resource file, json format.
    • Different files for each language.
    • A Key - Value pair for each string.
  • At the start of the game, load the selected's language file into a data structure (ds_map), a global variable?.
  • Access de data structure by its key wherever a text is required (dialog, menu).
  • If the player changes the selected language (a menu option) reload the file.
Based on your experience with GML and Gamemaking, It's this a good aproach? Do you know any other ways?

Best regards.
 

NightFrost

Member
Yes, should be doable that way. I think many people here who do multilanguage games use json with key - value lists as their preferred storage method. In web design, many years ago company I work for simply used associative arrays with key - value paired translations (in GMS terms, that's an array that uses DS map type keying). Then came web frameworks and their built-in translation support (aka i18n), but the basic content setup method was still the same, key - value pairs for all text.
 
Top