Use Unity's Localization package
Goal: a game that already uses Unity’s Localization package shows its String Table texts in Intrigues, and Intrigues follows Unity’s language.
Your Intrigues texts stay the source of truth. Without the bridge, nothing of Unity’s package is used.
- Install Unity’s Localization package. The bridge is compiled only when the package is in the project.
- Add the component: Add Component > Intrigues > Unity Localization Bridge. One per object.
- Set String Table to the name of a String Table Collection. Empty means the bridge only follows Unity’s language.
- Leave Follow Unity’s language on to have Intrigues change language when Unity’s selected locale changes. The locale
fr-CAshows the game’sfrwhen there is nofr-CA. - To fill a table from your story, choose Tools > MrW > Intrigues > Unity Localization > Copy Intrigues Texts To A String Table…. Pick the Story (the Intrigues database), pick a String Table or New String Table…, and press Copy Into The String Table. It is one undo step (a table it had to add stays).
- To bring a table’s texts into your story, choose Copy A String Table To Intrigues…, pick the table, and press Read The String Table. You see a report first, and nothing is written before you press Apply.
You will see: with the bridge on, the texts of the chosen table in the language Unity shows are asked before your story’s own texts. An entry named like a named text ({text.key}) gives that text. An entry named # and 16 hex digits gives the translation of a text written in the story, the id that the copy writes.
Good to know
Section titled “Good to know”- Values are read as written. Smart Strings do not format them, so Intrigues fills in its own
{…}tokens. - When copying into a table, named texts go under their name and texts written in the story under their id, with the text as the comment. Values that exist are overwritten, and empty texts never clear one.
- If the Intrigue Manager is made later than the bridge, for example in another scene, call
Reload()on the component. TheStringTableandFollowUnityLanguageproperties exist too.
What can go wrong
Section titled “What can go wrong”- “This project has no String Table Collection yet.” It shows only in Copy A String Table To Intrigues…. Make one in Unity’s Localization Tables window first.
- A locale that stands for no language of the game, and Unity’s pseudo-locales, change nothing. One information line says so.
- The component is not in the Add Component menu: the Localization package is missing.
- Messages from the bridge, such as no Localization Settings in the project, no Intrigue Manager in the scene, or no String Table chosen, are listed on Localized Text and the bridge.
For adding a language to the story itself, see Add a language.