Unity plugin is a package for Unity which allows Unity developers to synchronize their localized strings in Unity with Phrase Strings.
Phrase Unity plugin relies on Unity Localization package. It assumes that the Unity developer is using or plans to use localization through Unity Localization, in particular String Table Collections.
In order to get started with Unity Localization, refer to the guide.
After you create initial set of locales and one or more String Table Collections, and connect them with some text objects (and/or start using them programmatically from your Unity scripts), you can install and start using Phrase Plugin, which can be installed in following ways:
- Install from the Asset Store (TBA)
- Install from package archive
- Assets → Import Package → Custom Package… → choose
.unitypackage
file from disk
- Assets → Import Package → Custom Package… → choose
- Install from locally checked out source code
- Either check out the source directly into
YourProject/Packages/com.phrase.plugin
directory, or - symlink
unity_plugin
directory intoYourProject/Packages
ascom.phrase.plugin
- Either check out the source directly into
Afterwards one should be able to add a Phrase provider asset to their project (Create → Localization → Phrase):
Set up your connection data (environment and auth token created on Phrase, 1 above) and you will be able to fetch the list of projects and choose one.
The list of locales will be fetched automatically, and if the list of locales in Unity doesn’t match the list on Phrase, you’ll be able to create missing ones on either side (2 above).
You should also connect the string tables that you would like to sync with Phrase by checking them in the list (3 above).
Then you can start by pushing the initial key list to Phrase (usually only the source locale).
After the keys have been translated to target locales, you can pull then back to Unity here.
You can perform push/pull from Phrase Provider screen, but also from “Phrase Extension” on the string tables themselves:
There you push/pull only the target table. This extension also enables you to constrain the subset of keys that will be pushed/pulled to the particular table, by selecting the “Identifyer Type”:
-
“Key Prefix” – only keys with the given prefix in their names will be imported to the target table.
-
“Tag” – only keys with matching tag will be imported to the target table. Upon pushing, all keys from this table will get this tag assigned.
-
“None” – all keys will be imported to the target table.
Additionally, you can open (and potentially dock) a “Phrase” editor window, by choosing Window -> Phrase from the menu. This window enables you to easily see keys attached to the text objects from the scene, edit their metadata and upload screenshots:
It shows all the text objects from the selection which are connected to a string table/key (more about that in general Localization Quick Start Guide), shows their assigned key, and enables the user to set their description and maximum character length, which will be synchronized with Phrase upon the next push from the containing String Table.
The user can also open the key in Phrase editor (in external browser tab) by clicking on “Open in Phrase” next to the key name, and copy the key name to the clipboard.
There is also a button for exporting a screenshot (current game view) to Phrase, which will also attach the uploaded screenshot to all listed Phrase keys.
If you want to contribute, check out this project directly into Packages
directory of your project and rename the package directory to
com.phrase.plugin
. You can also create a symlink to it instead.
- Increase version number in
package.json
andEditor/PhraseClient.cs
- Update
CHANGELOG.md
- Publish the release on the Asset Store