Internationalization (i18n)

Charon supports storing text data in multiple languages by using the special LocalizedText data type.

A list of possible translation languages is defined in the Project Settings.

There are two ways to pass translatable text to a third party (e.g., for localization or editing):

  • You can export all translatable data as an XLSX spreadsheet.

  • You can use the special localization format, XLIFF (XML Localization Interchange File Format).

Translation flow via UI

To export and translate your project’s data, follow these steps:

  1. Go to the dashboard of the project for which you want to generate source code.

  2. Click on the “Internationalization Settings” link.

  3. Click on the “Export” button to export the data.

  4. Download the exported file and provide it to your translation team for translation.

  5. Once the data has been translated, click on the “Import” button on the same page.

  6. Select the translated file and follow the steps provided in the import wizard.

Translation flow via CLI

Exporting to XLSX spreadsheet

To export translatable text data as XLSX, run the DATA EXPORT command with the following parameters:

Charon.exe DATA EXPORT --dataBase "c:\my app\gamedata.json" --properties [LocalizedText] --output "c:\my app\text_all_languages.xlsx" --outputFormat xlsx
  • Use --properties [LocalizedText] parameter to indicate that only the properties containing LocalizedText should be exported.

  • Use --languages parameter to limit the number of exported languages.

Extra columns may be present in the export files, which are required for the correct import of the translated data.

Importing from XLSX spreadsheet

Once your data is processed (e.g., translated), you can import it using the DATA IMPORT command with the safeUpdate mode:

Charon.exe DATA IMPORT --dataBase "c:\my app\gamedata.json" --input "c:\my app\text_all_languages.xlsx" --inputFormat xlsx --mode safeUpdate

Exporting to XLIFF

To export translatable text data as XLIFF, run the DATA I18N EXPORT command with the following parameters:

Charon.exe DATA I18N EXPORT --dataBase "c:\my app\gamedata.json" --sourceLanguage en --targetLanguage fr --output "c:\my app\en_fr_texts.xliff" --outputFormat xliff
  • Use the --outputFormat parameter to indicate the exact format of the exported data, which can be either xliff, xiff1, or xliff2.

  • Use --sourceLanguage to indicate the language text is being translated from as the source, and --targetLanguage to indicate the target language that the text is being translated to.

  • To get a list of configured translation languages for the game data, run the DATA I18N LANGUAGES command.

Importing from XLIFF

Once the data has been processed, you can import it using the DATA I18N IMPORT command.

Charon.exe DATA I18N IMPORT --dataBase "c:\my app\gamedata.json" --input "c:\my app\en_fr_texts.xliff"

Other formats

While the export and import commands may accept other formats, it cannot be guaranteed that they will be supported.