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 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 local development always uses suggested translations and not live translations 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 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 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 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 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 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 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 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 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 a dictionary \<string, string > dictionary \<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, 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}} 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 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