mirror of
https://github.com/Relintai/godot_translation_editor.git
synced 2024-11-20 08:37:18 +01:00
Fixed window titles not being detected
This commit is contained in:
parent
3cdfde5f28
commit
dc763e93df
@ -96,7 +96,11 @@ func _index_file(fpath: String):
|
||||
|
||||
func _process_tscn(f: File, fpath: String):
|
||||
# TOOD Also search for "window_title" and "dialog_text"
|
||||
var pattern := "text ="
|
||||
var patterns := [
|
||||
"text =",
|
||||
"window_title =",
|
||||
"dialog_text ="
|
||||
]
|
||||
var text := ""
|
||||
var state := STATE_SEARCHING
|
||||
var line_number := 0
|
||||
@ -110,9 +114,17 @@ func _process_tscn(f: File, fpath: String):
|
||||
|
||||
match state:
|
||||
STATE_SEARCHING:
|
||||
var i := line.find(pattern)
|
||||
|
||||
var pattern : String
|
||||
var i : int
|
||||
for p in patterns:
|
||||
i = line.find(p)
|
||||
if i != -1:
|
||||
pattern = p
|
||||
break
|
||||
|
||||
if i == -1:
|
||||
continue
|
||||
|
||||
var begin_quote_index := line.find('"', i + len(pattern))
|
||||
if begin_quote_index == -1:
|
||||
_logger.error(
|
||||
|
Loading…
Reference in New Issue
Block a user