How do I build spritefonts and text content so its easy to localize?

0 favourites
  • 2 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • I'm building an NES/GBC style game, so it uses spritefonts. Currently, I am building all the menu/UI/dialog text to pull from a language array, where it simply pulls using a key word. For example, it might find the keyword "currency_menu" and return "Gold".

    To me this should work pretty well if I choose to ever localize in the future, theoretically I can just load a new language into the array, and switch the spritefonts for ones with the languages alphabet.

    Does this make sense? Is this a bad idea? I've never considered building for future localization until now.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It sounds like it works. Add another language and test to be sure.

    Scalability is essential, you don't want to change anything when adding new languages except adding a language file and a way of selecting that language file, but if you need to change other events/code, it's probably not optimal.

    In my experience, most of the time, companies use JSON-files. One for each locale and defined naming conventions like: en-US.json for American English, en-GB.json for British English, etc.

    One JSON-files is loaded when the game starts, and then other files are loaded when the user selects a language.

    What you find is easiest for you is probably the best solution if you are working solo.

    One thing that can be good to support is the possibility to pass variables to translation.

    E.g. If players can add there own name then it is nice if npc can use that name when talking to the player.

    All projects are different test things and you will find a solution.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)