Integrations

Unity (Strings)

Content is machine translated from English by Phrase Language AI.

Available for

  • All paid plans

The Unity plugin is a Unity Localization package that allows Unity developers to manage localization tasks by syncing their source strings and translations with Phrase Strings.

The plugin assumes that the Unity developer uses or plans to use localization through Unity Localization, in particular String Table Collections. Refer to Unity documentation to get started with Unity Localization.

Note

Due to continuous improvements, the user interface may not be exactly the same as presented in the video.

Set up the Plugin

Prerequisites

  • Create a set of locales and one or more String Table Collections.

  • Connect them with some text objects (and/or start using them programmatically from the Unity scripts).

Installation and Configuration

There are several ways to install the plugin:

  1. Install from the Asset Store.

  2. Install from the package archive by importing the local .unitypackage file as a custom package.

  3. Install from locally checked out source code by either:

    • Checking out the source directly into YourProject/Packages/com.phrase.plugin directory.

    • Creating a symbolic link to unity_plugin directory into YourProject/Packages as com.phrase.plugin.

Once installed, add Phrase Provider to the project’s assets and complete the configuration:

  1. Set up the connection environment and provide the API access token generated in Phrase.

  2. Fetch the available projects and select one from the list.

    The list of locales is fetched automatically.

  3. In case of locale mismatch between Unity and Phrase Strings, create any missing locales locally or in Phrase by selecting the relevant option.

  4. Select the String Tables to connect and sync with Phrase.

  5. Choose which locales should be pulled to Unity and which will be pushed to Phrase. This selection affects both global Pull/Push (on Phrase Provider inspector) and individual String table Push/Pull (on Table extension drawer).

    The settings are global and affect both the Phrase Extension (which only works on connected Collections) and the Phrase Window (which only display keys from connected String Tables).

The initial key list (usually only the source locale) can now be pushed to Phrase Strings. Once translated to target locales, keys are pulled back to Unity through the same Phrase Provider screen.

Note

Push and pull operations are also available from the Phrase extension on a String Table Collection.

Use the Plugin

Push and Pull

Users can push and pull localization keys from the Phrase Provider screen (and that synchronizes all the connected String Tables with Phrase), and from the Phrase extension drawer on the individual String Tables.

When a String Table is connected with the Phrase Provider, its inspector shows a Phrase drawer, which allows pushing and/or pulling content from the the table. String Tables not connected with Phrase Provider will not have Phrase drawer; the extension will only appear when a String Table Collection is linked.

Users commonly organize translations into multiple String Table Collections. Examples would be based on the game section or the type of the items referred to (e.g. Weapons, Items, Characters etc). In this case, connecting a collection with only some of all existing translation keys in Phrase Strings would be required. Select an options in the Only Keys Matching dropdown to specify the subset of keys that will be pushed/pulled to the particular table:

  • Key Prefix 

    Only keys with the given prefix in their names are imported (pulled) to the target table. The Unity key names will not contain the prefix itself. When pushed, the whole table is uploaded to Phrase, and prefixes are automatically appended to the key names.

  • Tag 

    Only keys with matching tag are imported to the target table. When pushed, the tag is assigned to all keys from this table.

  • None 

    All Phrase keys are imported to the target table when pulled (typically when there is only a single Collection connected with Phrase).

Note

Pushing and pulling from the Table extension drawer respects the list of the locales chosen on Phrase Provider inspector. To only synchronize content from a single table collection, do so from the Phrase Extension. To synchronize all connected content, use the Phrase Provider.

Phrase Window

Select Window/Phrase from the menu to open the Phrase editor window and attach it to the main interface, if needed.

The Phrase window lists keys attached to the text objects from the localization scene, and offers editing their metadata and uploading screenshots.

It shows all text objects from the selection that are connected to a Phrase-enabled String Table and their associated keys. Users can set key description and maximum character length, which will be synchronized with Phrase the next time the containing String Table is pushed.

Note

You can also view and edit the key metadata (such as description and max length) from the String Table Collection editor. 

Use the Update screenshot button to export a screenshot of the current game view and attach it to all listed Phrase keys.

Click Open in Phrase next to the key name to open the key in the Phrase Strings editor.

Was this article helpful?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.