Localized Text and the Localization Bridge
What this page is for
Section titled “What this page is for”Two components handle translated text in your scene. Localized Text puts a translated text on a label. The Unity Localization Bridge lets a game that already uses Unity’s Localization package show its String Table texts, and follow Unity’s language. Your Intrigues texts stay the source of truth: without the Bridge, nothing of Unity’s package is used.
Localized Text
Section titled “Localized Text”Add it from Add Component > Intrigues > Localized Text, on an object that has a TextMesh Pro label (UI or 3D) or a legacy Text. It writes the translated text into the label, and writes it again when the language or the texts change. In a right-to-left language a TextMesh Pro label reads right to left, with left and right alignment swapped. Tokens such as {world.Year} in a text are filled in.
It has one value, the key of a named text. The Inspector shows:
| Part | What it does |
|---|---|
| Text | A button that opens a searchable list titled Named text. It reads “None: the label’s own text” until you pick one. Clear puts it back. |
| Text in each language | After you pick a known text: its value in every language, “(empty)” where there is none. |
| New named text | A field and Add. Makes a named text with that name, empty in every language, and uses it on this label. |
| Open the Texts page | Opens the Studio on the Texts page. |
With a key, the label shows that named text in the current language. With no key, the words typed on the label are treated as a line of your story, and a translation of that line is shown if the Texts page has one. A key that is not in the database shows a missing-text marker; the Inspector says so and offers Create it.
The Inspector reads the database the Studio has open, else the scene manager’s, else the one the Studio showed last. With none, it says to open the Studio or add an Intrigue Manager, and falls back to a plain text field called Named text. A named text needs a language first: with no language, add one on the Texts page.
The label stays as you typed it until the Intrigue Manager exists, so a key never flashes a missing marker at start.
The Unity Localization Bridge
Section titled “The Unity Localization Bridge”Add it from Add Component > Intrigues > Unity Localization Bridge. One per object. It exists only when Unity’s Localization package is installed in the project (version 1.0.0 or later, by the assembly definition’s version define). Without the package, the component is not compiled.
| Setting | What it does | Default | When to change it |
|---|---|---|---|
| String Table | The name of the String Table Collection whose texts are shown. Empty: the Bridge only follows Unity’s language. | empty | Always, to name your collection. |
| Follow Unity’s language | When Unity’s selected locale changes, Intrigues shows the same language. | on | Off, if Intrigues should keep its own language. |
The Inspector adds one note: the table’s texts are shown before the story’s own, named texts by their name, texts written in the story by their id.
How it reads the table:
- An entry named like a named text key gives that text.
- An entry named
#and 16 hex digits gives the translation of a text written in the story. The copy tool writes these. - Values are read as written, never formatted by Smart Strings. Intrigues fills in its own
{…}tokens. - A locale picks the language of the game with the same code, else the same language:
fr-CAshowsfr. A locale that matches no language of the game, and Unity’s pseudo-locales, change nothing. One information line says so.
Three code members: the properties StringTable and FollowUnityLanguage, and the method Reload(), which reads the table again (for example after its texts changed, or when the manager came later). Call it if the Intrigue Manager is made in another scene; otherwise the Bridge follows the next change of Unity’s language.
Copy tools
Section titled “Copy tools”Two menu items under Tools > MrW > Intrigues > Unity Localization:
- Copy Intrigues Texts To A String Table…
- Copy A String Table To Intrigues…
Mistakes and messages
Section titled “Mistakes and messages”- “The Unity Localization Bridge found no Localization Settings in this project, so it shows nothing of Unity’s tables.”
- “The Unity Localization Bridge found no Intrigue Manager in the scene, so it cannot follow Unity’s language.”
- “The Unity Localization Bridge has no String Table chosen, so it only follows Unity’s language.”
- “The String Table ‘(name)’ could not be loaded for (code); Intrigues shows the story’s own texts in that language.”
How it connects
Section titled “How it connects”- Texts and tokens
- Intrigue Manager inspector: languages and Language At Start.
- Use Unity Localization