Skip to content

Commit 9ff4f8c

Browse files
committed
Only save translated files
1 parent 25b5aa7 commit 9ff4f8c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.migration/rst2po.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def update_po_translation(pofilename, english, spanish):
106106

107107

108108
for pofilename in glob.glob(PO_DIR + '**/*/*.po'):
109+
translated = False
109110
rstfilename = get_rst_file(pofilename)
110111
if rstfilename is None:
111112
continue
@@ -124,6 +125,10 @@ def update_po_translation(pofilename, english, spanish):
124125
if translated_text is None:
125126
continue
126127

128+
translated = True
129+
127130
entry.msgstr = translated_text
128131
# update_po_translation(po, english_text, translated_text)
129-
po.save(pofilename)
132+
133+
if translated:
134+
po.save(pofilename)

0 commit comments

Comments
 (0)