What is the best way to have translation strings?

0 favourites
  • 2 posts
From the Asset Store
This collection of music is the beautiful performance of rather small strings ensemble (8 first violins, 6 second violin
  • New to C3 here. How should I go about applying translation strings to text in game?

    For example I'm going to have buttons on the main menu for "Story" "Options" and "Exit", and I'll have text in other layouts that will need to be interchangeable with text in other languages.

    How would I set it up such that I can set the language of the game at the start, save that decision, and then apply alternate language text across the whole game?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is an official template that demonstrates how to do it:

    editor.construct.net

    To auto-detect language on startup you can use Browser.language expression. lowercase(left(Browser.language,2)) will give you a two-letter language code, for example "en" or "de".

    Also, for static texts you can automatically grab translations from the array. Here is how I do it - I add all static text object into a family "LanguageTexts". Define "tag" instance variable on the family. On start of layout I loop through all LanguageTexts using "For each" loop, lookup translation in the table with each tag and update the texts.

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