Localization - POINT-VR/POINT-VR-Chapter-1 GitHub Wiki

Preface

This guide features a quick tutorial on how to do some tasks related to the localization of UI text in the simulation. For localization of subtitles, please refer to Subtitles instead.

We are using Unity's Localization Package (Quick Start Guide) to handle translations for UI text.

Adding a new language

For translators

  1. Download the Translations.csv file from this GitHub repository.

If you already have it downloaded, please make sure that it is fully updated with the latest changes, otherwise you may overwrite someone else's translations!

  1. Look for the ISO 639-1 code for the language that you are going to add.
  2. Open up Translations.csv (you can use Excel) and add a column with the corresponding translations. The column header should follow the format (<ISO 639-1 code>).

image

  1. Upload the new file to the GitHub repository at the same place at its original location. If you are not able to do so, let Mireille / Sonali know on Discord!

For developers

  1. Pull from the develop / main branch (whichever one has the updated translations).
  2. Open the POINT VR project on Unity, and navigate to LocalizationSettings.asset. In the Inspector, click on Locale Generator.

image

  1. In the Locale Generator, find the language(s) to be added, ensure that they are selected, then click Generate Locales. Save to the LocalizationAssets folder.

At this stage, also help ensure that the column headers in Translations.csv match the format <Name>(Code) as is listed in the Locale Generator table.

image

  1. From Project View, click on UI Localization.asset. Then, click on Create in the Inspector for any new locales added.

image

  1. Click on Open in Table Editor.

image

  1. Within the Table Editor, click on the menu (...) on the top right, Import > CSV and select Translations.csv.

image

The table should populate with the new translations and you should be good to go!

Set Up a UI Element for Localization (Developers Only)

  1. Find the TextMeshPro (Text also works but is not used in the project) component that requires localization. Right-click on the component in the Inspector and select Localize.

image

  1. This will add a Localize String Event to the Inspector. Click on String Reference and select the correct key from the dropdown.

image

You are all set!

⚠️ **GitHub.com Fallback** ⚠️