Every line in a Yarn Script can have an ID, called a line tag. The Dialogue Runner uses the ID to find everything that belongs to the line: its translated text, its voice clip, and any image that goes with it.
Rosa: The lamp's been out for days. #line:a1b2c3d#line:a1b2c3d is the line’s ID. The addon can add one to every line, so you don’t have to write them by hand.Translated text
Yarn Spinner for Godot uses Godot’s own translation system. When a line runs, the Dialogue Runner looks up its text in Godot’s TranslationServer, using the line’s ID with YARN_ in front. If there’s no translation for the current language, it uses the text written in the Yarn Script.
To get your lines to translators, export them from the Yarn Project as a CSV file. Each row has the key and the line’s text. Translators add a column for each language, and Godot imports the file as translations, the same way as any other translation CSV:
keys,en,de
YARN_line:a1b2c3d,Rosa: The lamp's been out for days.,Rosa: Die Lampe ist seit Tagen aus.Voice clips and images
Voice clips and images are found by the line’s ID as well. A clip called a1b2c3d.ogg in res://audio/dialogue/ belongs to the line tagged #line:a1b2c3d. For other languages, Godot’s translation remaps can swap in a different clip for the same line. See Voice-Over.
flowchart LR
line["Rosa: The lamp's been out for days.<br>#line:a1b2c3d"]
subgraph godot["Godot"]
direction TB
translations[("Translations<br>YARN_line:a1b2c3d")]
audio[("res://audio/dialogue/<br>a1b2c3d.ogg")]
end
line -->|"translated text"| translations
line -->|"voice clip"| audioIn this section
- Localising Your Game: adding line tags, exporting and importing translations, and switching language while the game runs.
- Line and Asset Providers: how the Dialogue Runner finds each line’s text, voice clip and image, and how to change it.