Skip to content

Commit

Permalink
fixed infinite loop in import
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetragramat committed Mar 5, 2023
1 parent ca2cc6b commit 9688ff9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions screens/ManualTranslate.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Panel" type="Panel" parent="."]
anchor_right = 1.0
Expand Down
6 changes: 6 additions & 0 deletions scripts/text_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ func _init():
printerr("Unable to compile regex")

func import(path: String, translations: Dictionary) -> void:
# translations contains extracted with removed duplicates
var lines = _extracted

if lines.empty():
return

# replace original lines with translations
for key in translations:
# if translation is same as original then skip the value
if key == translations[key]:
continue

var index = 0

while true:
Expand Down

0 comments on commit 9688ff9

Please sign in to comment.