fix(dialogs): use default text for dialog options if text is untranslated

This commit is contained in:
2023-10-20 21:34:34 +02:00
parent 876a19b932
commit fd3a648161
2 changed files with 12 additions and 2 deletions

View File

@@ -52,8 +52,18 @@ func load_string(option_string: String):
func get_option():
# Check if text has a key
if ":" in option:
return tr(option.split(":")[0])
var splitted_text = option.split(":")
var key = splitted_text[0]
var translated_text = tr(key)
# If no translation is found use default text
if key != translated_text:
return tr(key)
if splitted_text.size() > 1:
return splitted_text[1]
return option