I2 Localization Support

This page describes how to set up the Dialogue System with Inter Illusion's I2 Localization. (I2 Localization is required.)

I2 Localization copyright © Inter Illusion.

I2 Localization Integration Features

The I2 Localization Support package adds these features:

  • A DS To I2 editor window that allows you to copy data to and from I2 Localization's I2Languages prefab. Use this to populate the I2Languages prefab with your dialogue database content, translate in I2 Localization, and then copy the translations back into your dialogue database.
  • A script to automatically set the Dialogue System to use I2 Localization's current language.

I2 Localization Setup

Import the package Third Party Support ► I2 Localization Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► I2 Localization Support.

I2 Localization Assets

This integration can work with:

  • The default I2Languages asset that I2 Localization puts in Assets ► Resources.
  • Any other LanguageSourceAsset in your project.
  • Or a LanguageSource component in the current scene.

If the currently-open scene has a LanguageSource component, it will always be used first.

The default I2Languages asset and other LanguageSourceAssets or LanguageSource components you use with this integration should all have the exact same language list, in the exact same order.

Language Identifier Options

By default, the I2 Localization integration will name localized fields in your dialogue database and/or localized text table using I2 Localization's language codes. This is preferable to using language names because language codes are typically standard ASCII text, whereas language names may contain non-ASCII international characters that can cause problems when translating field names into the Lua environment.

In the DS To I2 editor window and the Dialogue System Use I2 Language script, you can specify whether to use language codes or language names, but language codes are recommended.

How to Use I2 Localization with the Dialogue System

  1. Select menu item Tools → Pixel Crushers → Dialogue System → Third Party → I2 Localization → DS To I2.
  1. Assign your dialogue database to the Database field.
  2. Optionally assign a text table to the Text Table field (see Text Tables).
  3. If you want to use an i2 source other than the default Resources/I2Languages.asset, tick Specify I2 Asset.
    • Note: If the current open scene has a LanguageSource component, the DS To I2 window will use this LanguageSource instead of an I2 asset.
  4. Expand the category foldouts and specify which fields you want to localize.
  5. Click the To I2 button to copy these fields to I2 Localization's I2 asset.
    • It will also initialize the first language value with the field's value.
    • Note: This button does not copy translations from the dialogue database to the I2 asset, since translations should usually come from the I2 asset. However, if you need to copy translations from the dialogue database to the I2 asset, tick the Translations To I2 checkbox.
  6. Click the Inspect I2 button select the I2Languages prefab.
  7. Add languages on the Languages tab.
    • If you want to use Google Translate, click the Translate button next to each language.
    • Otherwise translate the terms in I2Languages using your normal I2 Localization process.
  8. Back in the DS To I2 window, click the From I2 button to copy these translations back to the Dialogue System.

You may also find it helpful to use the Localization Tools Window to copy Dialogue Text and Menu Text to the primary language fields (e.g., 'Dialogue Text' to 'en' and 'Menu Text' to 'Menu Text en').

Dialogue System Use I2 Language

Add the script Dialogue System Use I2 Language to the Dialogue Manager to automatically set the Dialogue System to use I2 Localization's current language in this script's Start method. Make sure I2 Localization has set its current language before this script's Start method starts. To verify that the Dialogue System is using the correct language, inspect the Dialogue Manager's Localization Settings at runtime, or check Localization.language in a build.

If you change languages in I2 Localization, call the script's UseCurrentI2Language() method to inform the Dialogue System.

You can also tick Use I2 Language At Runtime to make the Dialogue System pull translations from I2 Localization at runtime. Currently this pulls Menu Text and Dialogue Text fields. Set the dropdowns to match the values you used in the DS To I2 window.

Dialogue System Use I2 RTL Fix

If your dialogue uses right-to-left (RTL) languages, add the script Dialogue System Use I2 RTL Fix to the Dialogue Manager. When displaying right-to-left content, it will apply I2 Localization's RTL fix, set subtitle typewriter effects to type right to left, and optionally set subtitle text to right-side alignment.


<< Third Party Integration