Documentation menu

Format reference

Locale

Translations live in their own files, one folder per language under locales/, so a translator works inside a single folder and never edits story files. A translation file has the same shape as its source, with only the text fields kept.

Schema

OSF.osf source
locales/Rus/01_intro_scene.osf
Locale Rus {
  Dialogue 01_intro_scene {

    Node node_01 {
      text: "Где я?"
    }

    Node node_03 {
      text: "Я сплю?"
      Option say_yes { text: "Да, спишь." }
      Option say_no  { text: "Нет. Глупец" }
    }
  }

  Character stranger { name = "Незнакомец" }
}
locales/Rus/01_intro_scene.yaml
apiVersion: i18n/v1
kind: Locale
data:
  language: Rus
  values:
    Dialogue.01_intro_scene.nodes.node_01.content.text: Где я?
    Dialogue.01_intro_scene.nodes.node_03.content.text: Я сплю?
    Dialogue.01_intro_scene.nodes.node_03.options.say_yes.content.text: Да, спишь.
    Dialogue.01_intro_scene.nodes.node_03.options.say_no.content.text: Нет. Глупец
    Character.stranger.name: Незнакомец

Translation keys

In YAML and JSON each text is a key: Kind.id followed by the path to the text field. Translations are matched to their source by key, not by file path.

TextKey
Story nameStory.<id>.name
Character nameCharacter.<id>.name
Character descriptionCharacter.<id>.description
Dialogue nameDialogue.<id>.name
Node textDialogue.<id>.nodes.<node>.content.text
Node titleDialogue.<id>.nodes.<node>.content.title
Option textDialogue.<id>.nodes.<node>.options.<option>.content.text

Rules

  • Only text fields are allowed: name, description, title and text. next, speaker, set, requires and start are errors.
  • Error: a key that is not a text in the story, which catches renamed nodes.
  • Error: the same text translated twice for one locale.
  • Error: a locale that is not in the I18n configuration.
  • Error: a translation whose {{ }} references differ from the source text.
  • Error for enforce = true, warning otherwise: a text with no translation.