Game Developer API
Search…
Language + Translation
Legends of Learning users speak multiple languages and we require games to be multi-lingual.
Practically, this means:
  1. 1.
    Storing game text in a separate data file (JSON) and uploading it during game submission.
  2. 2.
    Subscribing and receiving a language payload during game initialization.
Important: Language selection will happen outside than the game, via teacher or student settings. A game needs to handle multiple languages, but only one language will be passed in at a time.
In the StartGame payload, the language is specified. Use this to select a font.
1
{ "languageCode": "en" }
Copied!
The Language payload contains keys and values for a single language.
1
{ "welcome": "myText" }
Copied!
For development, you can use a multi-language file like this. Use the languageCode key from your StartGame handler to call the LanguageDefsReceived with the key, in pseudocode: language[startKey['languageCode'].
Unity developers can reference the Example Project's Loader.cs for more examples.
1
{
2
"_meta": {
3
"maxChars": {
4
"welcome": 50
5
}
6
},
7
"en": {
8
"welcome": "Welcome"
9
},
10
"es": {
11
"welcome": "Bienvenido"
12
}
13
}
Copied!
This file is also used in game upload. The minimum required keys are
  • _meta with maxChars key/value each language key
  • en english
Note: The language file should be formatted as seen above. Using an array structure will not be accepted.
It is highly recommended that developers test Spanish text in their games to verify font and UI compatibility. I.e., check that special characters like accents and tildes render properly, and that translated text fits within the text boxes.
Last modified 3mo ago
Copy link