AirConsole Games Features
Improving your game engage

Game Language Translations

16min

Translating your games to multiple languages broadens your audience.

1. Basics

  • Every displayed text in your game is a string (Graphics can not be translated).
  • Every string has an ID. Example: The text "Welcome to our game" could have the id "welcome_message".
  • Every string has to be registered in AirConsole's translation console.
  • You or AirConsole Translators can translate all your string in the translation console to any language
  • You don't have to worry about language selection / loading language files.
Document image


2. AirConsole Translation console

The translation console is the central repository for all your strings. Any string that you want to have translated needs to be in there.

The translation console can be found in the developer console, inside one of your games under "Translations". You first need to register a game in the developer console before you can start adding translation string.

To add new translation strings, just follow the instructions in the translation console.

Once you have translation strings registered, you can select a language in the drop down and start to translate them. You can also add additional translators by email address to get some help with other languages. These translators can only suggest translations, but can not create or modify translation ids.

Anytime a translator or you changes a translation, you need to approve the suggestion before it goes to production. You can preview the changes with the "Preview" buttons.

Local development always uses suggested translations and not live translations.
Document image


3. Using Translation Strings in your game

To use translations, you need to call the AirConsole constructor with the option translation: true

new AirConsole({"translation": true})

Once you have registered a string in the translation console, you can start using it inside your code. Assuming you have registered a string welcome_screen that has the English value "Welcome to our game", you can retrieve it using:

airconsole.getTranslation("welcome_screen");

If the users language is English, it will return "Welcome to our game".

For static html translations you can use the data-translation attribute. This will automatically fill in your static translation:

<span data-translation="welcome_screen"></span>

This will result in:

<span data-translation="welcome_screen">Welcome to our game</span>

Translation strings can use replacement parts. For example welcome_user could be have an English value of Hi %username%. To retrieve the translated string with the username filled in, you can call:

airconsole.getTranslation("welcome_user", {"username": "Tom"});

which would result in "Hi Tom".

Replacement parts can only be used in programatically and can not be used with the static html attribute data-translation.

You should never concatenate translation strings to build a sentence. Always use replacement parts instead. Different languages have different sentence structures.

To preview a different language, add the "?language" parameter when loading AirConsole. e.g.: www.airconsole.com/?language=de

4. Advanced usage

You can also use your own translation system. A quiz for example could load different questions depending on the current language. To get the current language, call:

airconsole.getLanguage()

This could also be abused to load different images depending on the users language and therefor you could use graphics containing texts.

Note that the AirConsole Translation team will not be able to help you with your translations.

5. Translations in Unity

To enable translation functionality within your Unity project, do the following on your AirConsole Game Object:

  • enable the Translation checkbox.
  • enter your game id.

You can see the translation functionality in action in the 'translations' example scene that you can find in your plugin under Assets/AirConsole/examples/translations.

The example scene uses a few pre-defined translation strings set up for the game ID com.airconsole.plugin.unity. You can request these for testing purposes, but you cannot edit them or add more.

To test translations within the Unity Editor, you need to create an entry for your game in our Developer Console. This is where you define your Game ID.

Request an individual translation string by id:

string welcomeScreenTranslated = AirConsole.instance.GetTranslation("welcome_screen");

Request a translation with replacement parts. The values have to be passed along as aDictionary <string, string >:

string welcomeUserTranslated = AirConsole.instance.GetTranslation("welcome_user", new Dictionary <string, string> { { "username", "Tom" } });

You can translate multiple UI Text or Text Mesh elements (without replacement values). For it to work, thetextproperty of the UI Text or Text Mesh needs to contain the translation ID string within double curly brackets:{{welcome_screen}}

public Text[] textsToTranslate; void OnReady(string code) { AirConsole.instance.TranslateUIElements(textsToTranslate); }
You cannot test different languages within the Unity Editor. Upload your Game to the Developer Console to enable and test different languages.

6. Importing and exporting translations

The importing/exporting translations functionality simplifies the process of working with changes on many string IDs, whether creating a new one or editing the existing ones.

All translations are imported from or exported to the .xlsx file format.

The import and export buttons can be found in the side menu.

Importing Translations

The import file must have the following structure:

  • The first column represents translation IDs.
  • Each other column represents one of the languages that you are importing.
  • The header row for the translation IDs, which is the first column, must have the value "string-id".
  • The header row for each language column contains the value of the language code for the language being imported. You can find available languages and their corresponding codes below.
  • For each row, the string ID name is in the first column, and each corresponding language column contains the value of the string ID in the imported language.

This is an example of the import file:

Document image


You can download a template here.

When translations are imported, the following rules apply:

  • When importing translations with new string IDs, the new string IDs will be automatically registered with the default metadata:
    • Devices: Available on both
    • Description:
    • Render limit: No
  • If you import a new string ID, the string ID value in the English column is mandatory.
  • All translation string ID's new values in importing languages will be displayed in the translation console as new changes in the corresponding language section and have to be manually approved. Only English values of the new string IDs will be automatically approved as the part of the process of the registration of the new string IDs.
  • A string ID with an empty value in a language column does not delete the previous value from the database for that language. It just skips the importing of the value for the language.
  • The system's flexibility allows you to import new string IDs and edit the language values of the existing ones in the same import file.
  • If the import file contains irregularities, error messages will be displayed addressing the problems. Please correct all errors and try importing again.

Exporting Translations

  • All available translations for the game will be exported.
  • The export file structure mirrors the pattern defined in the import translations section.
  • The values of production translation string IDs are sorted in the columns by language, with the language code in the header row.
  • New translation string values that have not been approved are also sorted in the columns per language, with the language code suffixed with "-dev" in the header row.

Translation languages

The AirConsole platform is currently translated into the following languages: Chinese, English, French, German, Indonesian, Italian, Japanese, Korean, Portuguese, Portuguese(Brazil), Spanish, Thai, and Ukrainian, but you can provide your game in many more languages.