Skip to main content

Localization

StoryFlow Editor manages source text and translations for your project. The Godot plugin uses those translations when it reads dialogue, character names and authored string values. Language selection belongs to the whole StoryFlow Editor project, so every component uses the same selected language.

Importing Translations

Add target languages and translations in StoryFlow Editor, then run a full export, manual import or Live Sync. An exported project with target languages includes localization.json. The plugin imports this file alongside scripts, characters and Data Assets. Older exports without this file continue to use their source text.

Choosing a Language

Use StoryFlowRuntime.get_languages() to build a language picker. It returns an array of entries with code and name. The source language comes first. An empty array means the imported project has no localization data. set_language() returns true for an available language and false for an unknown code. Read the current selection with get_language().

GDScript
for language in StoryFlowRuntime.get_languages():
    print(language["name"], " (", language["code"], ")")

if StoryFlowRuntime.set_language("fr"):
    print("Selected: ", StoryFlowRuntime.get_language())

Updating Your UI

Connect to StoryFlowRuntime.language_changed(language_code: String) to refresh text you have already shown. The signal fires when the active language changes. New dialogue reads use the selected language, but the plugin does not redraw your custom UI automatically.

GDScript
func _ready() -> void:
    StoryFlowRuntime.language_changed.connect(_on_language_changed)

func _on_language_changed(language_code: String) -> void:
    refresh_visible_story_text()

Authored and Runtime Text

Authored dialogue, character names and declared Data Asset strings can be translated. Data Asset overrides and values written during play remain literal, so a language change does not translate text your game supplied at runtime. Map keys and other identifiers remain unchanged.

Language and Saves

Plugin save slots store story state, not the player's language choice. Loading a slot or starting a new story does not change the selected language. Save the code in your game's settings, then call set_language() when your game starts.

Component Language Property

The component's language_code property remains for projects exported before built-in localization. For a localized project, use StoryFlowRuntime.set_language() to change the project-wide language.

Need Help?

Join our Discord community to ask questions, share your projects, report bugs, and get support from the team and other users.

Join Discord