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.
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:
-
Install from the Asset Store.
-
Install from the package archive by importing the local
.unitypackage
file as a custom package. -
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 intoYourProject/Packages
ascom.phrase.plugin
.
-
Once installed, add project’s assets and complete the configuration:
to the-
Set up the connection environment and provide the API access token generated in Phrase.
-
Fetch the available projects and select one from the list.
The list of locales is fetched automatically.
-
In case of locale mismatch between Unity and Phrase Strings, create any missing locales locally or in Phrase by selecting the relevant option.
-
Select the String Tables to connect and sync with Phrase.
-
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
screen.Note
Push and pull operations are also available from the extension on a String Table Collection.
Push and Pull
Users can push and pull localization keys from the
screen (and that synchronizes all the connected String Tables with Phrase), and from the 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
dropdown to specify the subset of keys that will be pushed/pulled to the particular table:-
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.
-
Only keys with matching tag are imported to the target table. When pushed, the tag is assigned to all keys from this table.
-
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 editor window and attach it to the main interface, if needed.
The screenshots.
window lists keys attached to the text objects from the localization scene, and offers editing their metadata and uploadingIt 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.