Skip to content

Tutorial 13: Translate your story

Your story, written in English, also speaks French. You add the language, translate a text by hand, send the rest to a translator as a file and read it back, look at a text in French before you play, and put a button in the game that switches the language.

You need a scheme with a dialogue, such as The Letter from Make your first scheme, and an Intrigue Manager in your scene.

1. Say which language your story is written in

Section titled “1. Say which language your story is written in”
  1. Open Texts from the Page menu, then the Languages tab. With no languages it says that you add the language your story is written in first.
  2. Click Add a language under the list. A list titled Add language opens. Pick English, your story’s own language.
  3. Choose it in Source language of the story, above the list.
  4. The first time, a dialog Translate the story’s texts asks Create it now? Click Create. The translations go into a separate file beside the database.
  1. Click Add a language again and pick French (fr). Its code is fr.
  2. Select it in the list. Falls back to is your story’s language, so a text that is missing in French shows in English.
  3. Leave Plural forms at Automatic and Written right to left off.

The Code cannot change after the language exists. The row shows Has, how much of the story French has. It starts empty.

  1. Open the Story texts tab. It lists the texts written in your story, with Where and Used. A column for French sits after Used.
  2. Click the French cell of the letter’s dialogue text and type your translation. A text with several lines is written in the panel on the right.
  3. Keep every {token} the source has, such as {target.Name}. A translation that lacks one, or adds one, gets a note.
  1. Click Export…. The window Export texts for translators opens.
  2. Choose CSV (for a spreadsheet) under File. Under Texts, choose Story texts only. Leave French ticked. Switch on Only what still needs work.
  3. Press Export… again and choose where to save. A message says how many texts were written.

The CSV has the columns Kind, Id, Source, Note, Where, and one per language. Open it in a spreadsheet. The translator fills the French column and does not change Id. The file is UTF-8, so accented letters survive.

When it comes back:

  1. Click Import… and pick the file. A window says This is what the import will do. Nothing has been changed yet.
  2. Read the counts: Updated, Unchanged, New named texts, Orphans, Skipped. Read the {tokens} that differ from the source.
  3. Click Apply. It is one undo step.

Fill missing translations… is a machine draft. It sends nothing until you choose a service on Home ▸ Settings, under Automatic translation, and confirm.

In the toolbar, open the menu Preview language and pick French. Its first entry, As in the scene (no preview language), turns the preview off.

Only the previews change: the scene and the database keep their own language. On Story texts, the Preview in the panel shows the selected text in the language you pick, with names and pronouns filled in for a Conspirator and a Target you choose.

  1. In your scene’s UI, make a Unity Button.
  2. Add a Command Button to it. Set Command to Change Language and Language Code to fr.
  3. Make a second button the same way, with Language Code en.

On the Intrigue Manager, Active Language is the language the game starts in. In Play mode a change there switches the language at once. Remember The Player’s Choice is off at first: switch it on to keep the player’s last choice for the next start.

From code, one call does the same as the button. Example, not compiled. The signature is from IM.Localisation.cs:

IM.ChangeLanguage("fr");

An unknown language code changes nothing and logs one error.

  1. Press Play, then start your scheme, as in Play your scheme.
  2. Click the French button.
  3. Open the dialogue. By the rules above, a text with a French translation shows in French, and a text without one shows in English.

For a layout check that needs no translation, make a button with Language Code xx-pseudo. In the editor and in development builds, every text then shows accented and longer. It is never remembered.

  • A text stays in English. French has none for it, so the fallback shows. Look at Has.
  • Nothing happens on a click. The code is not a language of the game. Codes are compared as written.
  • The language is not kept. Remember The Player’s Choice is off.
  • Give words used in many places a name on Named texts, and write them as {text.name}.
  • Translate the built-in words, such as and, or and the dates, on Built-in words.
  • Add a voice to each language: Add a voice to a dialogue.

Related pages: Texts page and languages, Add a language, The toolbar, Intrigue Manager.