Skip to main content
Version: 1.3

EditorSproutyDialogsLocaleField

Inherits: MarginContainer

Description​

Component that allows the user to select a locale from the translation server, selecting the language and country using dropdowns or manual input. Suggestions matching the typed language or country code are offered while the code input is being filled, and the resulting locale code is validated before it is used.

Methods​

Return TypeMethod
Stringget_locale_code()
voidload_locale(locale_code: String)

Signals​

signal locale_removed(locale_code: String)

Triggered when the locale is removed with the remove button.


signal locale_modified

Triggered when the locale is modified, i.e. the code input text differs from the currently loaded locale.


Method Descriptions​

func get_locale_code() -> String

Returns the locale code from the current input. The language and country codes are validated against the translation server, printing an error and returning an empty string when they are not valid.


func load_locale(locale_code: String) -> void

Load a locale from a locale code, setting the code input text and selecting the matching language and country in the dropdowns.