Skip to content

Commit 25864f1

Browse files
committed
Added file content check before JSON (fixes #19)
1 parent 47431cf commit 25864f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • translate-messages/src/translate_messages/lib

translate-messages/src/translate_messages/lib/language.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def write_translations(cli):
5858

5959
lang_dir_path = cli.locales_path / lang_dir
6060
msgs_path = lang_dir_path / cli.msgs_filename
61-
if msgs_path.exists():
61+
if msgs_path.exists() and msgs_path.stat().st_size > 0:
6262
msgs = data.json.read(msgs_path)
6363
else:
6464
msgs = {}

0 commit comments

Comments
 (0)