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 = "Незнакомец" }
}compiled by
osf buildlocales/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.
| Text | Key |
|---|---|
| Story name | Story.<id>.name |
| Character name | Character.<id>.name |
| Character description | Character.<id>.description |
| Dialogue name | Dialogue.<id>.name |
| Node text | Dialogue.<id>.nodes.<node>.content.text |
| Node title | Dialogue.<id>.nodes.<node>.content.title |
| Option text | Dialogue.<id>.nodes.<node>.options.<option>.content.text |
Rules
- Only text fields are allowed:
name,description,titleandtext.next,speaker,set,requiresandstartare 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.