AirConsole Games Features
Improving your game engage
Game Language Translations
17 min
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 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 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 go to developers console 3\ using translation strings in your game to use translations, you need to call the airconsole constructor with the option translation true 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 welcome screen that has the english value "welcome to our game", you can retrieve it using if the users language is english, it will return "welcome to our game" for static html translations you can use the data translation data translation attribute this will automatically fill in your static translation this will result in translation strings can use replacement parts for example welcome user welcome user could be have an english value of hi %username% hi %username% to retrieve the translated string with the username filled in, you can call 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 data translation you should never concatenate translation strings to build a sentence always use replacement parts instead different languages have different sentence structures 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 this could also be abused to load different images depending on the users language and therefor you could use graphics containing texts 5\ translations in unity to enable translation functionality within your unity project, do the following on your airconsole game object enable the translation 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 assets/airconsole/examples/translations the example scene uses a few pre defined translation strings set up for the game id com airconsole plugin unity com airconsole plugin unity you can request these for testing purposes, but you cannot edit them or add more request an individual translation string by id request a translation with replacement parts the values have to be passed along as a dictionary \<string, string > dictionary \<string, string > you can translate multiple ui text or text mesh elements (without replacement values) for it to work, the text text property of the ui text or text mesh needs to contain the translation id string within double curly brackets {{welcome screen}} {{welcome screen}} 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 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 import example 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