Version: Unity 6.7 Beta (6000.7)
Language : English
Localization tables
Import and export table collections

Create and edit table collections

Create a table collection and author keys, translations, variants, and metadata.

A table collection holds your translations: one key per row, one locale per column. Create one collection per area of content, for example one for menus and one for narrative text. For the underlying concepts, refer to Localization tables.

Prerequisites

Before you start, make sure you have the following:

Create a collection

To create a table collection:

  1. Select Assets > Create > Localization > Resource Table Collection.
  2. Choose where to save the collection and its per-locale tables.

Unity creates a folder containing the collection asset, the shared key data, and one table per locale. When you move or rename the collection in the Project window, Unity keeps the sibling assets in sync. When you delete the collection, Unity also deletes the sibling assets.

You can also create new collections from the Resource Tables window. Refer to Resource Tables window reference.

Add a key and translations

To add a key and its translations:

  1. Open Window > Localization > Resource Tables.
  2. In the collection list, select the collection. The main view shows one row per key and one column per locale.
  3. Enter a key name and select Add Entry.
  4. Choose a type for the entry. Refer to Choose an entry’s type.
  5. Enter each locale’s value in its column.

Rename a key

To rename a key, double-click the key.

Renames keep the key’s ID, so references keep working.

Add a locale to the collection

To add a locale that exists in the project but isn’t yet in the collection:

  1. Open the Key column header menu ().
  2. Select Add locale, then choose a locale.

Unity creates the locale’s table for the collection and shows the new column.

To add a new locale to the project itself, refer to Add locales. To hide or show existing columns, use the Key column header menu’s Columns submenu.

Choose an entry’s type

You can’t change an entry’s type once it is created.

Select the entry type based on your needs:

  • Choose String if you want your key to hold text. You can also create dynamic text if you enable the Smart String toggle on a key. Refer to Localize strings and Make an entry dynamic.
  • Choose Asset if you want your key to hold an asset. Keys that hold an asset can reference an object or a Resources path per locale. Refer to Localize assets.
  • Choose Variant if you want your key to have multiple values chosen by a selector. Refer to Add variants.

Make an entry dynamic

Enabling the Smart string toggle on a key treats its values as Smart String formats. The toggle is available on String entries only. To enable it:

  1. Open the Resource Tables window and select the collection.
  2. Find the key’s row and click the actions menu () at the end of the row.
  3. Select Smart string.

The key’s values now evaluate at runtime with the arguments and variables you pass. Refer to Display dynamic values in a localized string for a complete example.

Add variants

Variants let a key hold several values chosen by a selector, for example one value per platform. Choose the selector when you create the key. To create a variant key:

  1. In the Resource Tables window, type a key name in the new-entry field.
  2. Open the Add Entry menu and choose Variant, then the entry type (String or an asset type), and then a selector.
  3. Enter each variant’s value in each locale column.

To add another variant to an existing variant key, click the row’s actions menu (), select Add variant, and then choose a variant key. Unity resolves variants automatically at runtime. For the underlying concepts, refer to Variants.

Attach metadata

Metadata attaches at four scopes: a single entry, a key across all locales, one table, or the whole collection. To attach metadata:

  1. In the Resource Tables window, open the row or column menu for the scope you need.
  2. Select the metadata action for that scope, for example Shared metadata on a key.
  3. In the metadata popup, add one of the built-in types.

Refer to Metadata (Localization tables) for the built-in types and to Metadata (Resource Tables window reference) for the menu locations.

Additional resources

Localization tables
Import and export table collections