Discourse includes an intuitive, incremental and manageable localisation workflow out of the box. This system revolves around the LocalisedText class, which holds a unique ID to key a string across an arbitrary number of languages (each in turn keyed by their corresponding language code [e.g. ‘en-us’]).
To export an Event’s strings for localisation, follow these steps:
- Select the graph asset you want to localise in the project view
- Right click the asset and select Discourse/Localisation/Export CSV
- Choose a directory to export the .csv file to.
- Once the export is complete, open the csv file in your spreadsheet editor of choice (e.g. Microsoft Excel).
- By default, any language codes listed on your ReferencesDatabase will appear as columns in the file, with rows keyed by a unique ID, containing the localised string for that language. These will be empty unless you have changed between languages in the Editor and edited the text in the PropertyPanel.
- Make any modifications to the text you see fit, or send it off for localisation.
- Once the text has been localised, save the CSV, then navigate back to the project.
- Select the Event asset you exported from, right click it and select Discourse/Localisation/Import CSV.
- Navigate to where you saved the localised CSV, select it and confirm the file dialogue.
- The import will shortly complete, and the next time you open the Event Graph you should find your strings have been localised! You can test this by changing the Source Language dropdown on the ReferencesDatabase asset.