Skip to content

Commit 74e3404

Browse files
cacresportobar
andauthored
Update scripts/complete_index.py
Co-authored-by: rtobar <rtobarc@gmail.com>
1 parent f3f4dc6 commit 74e3404

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/complete_index.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ def complete_index(po_files=None):
5454
po_file = polib.pofile(po_file_path)
5555

5656
# Ask to complete entries out of order with original text
57+
needs_save = False
5758
for entry in out_of_order_entries(po_file):
5859
user_input = input(f"\n{entry}\nIs this a index entry? (y/N):")
5960
if user_input.lower() == "y":
6061
entry.msgstr = entry.msgid
61-
po_file.save() # Save if an entry has been modified
62+
needs_save = True
63+
if needs_save:
64+
po_file.save()
6265

6366
except KeyboardInterrupt:
6467
break

0 commit comments

Comments
 (0)