From 44f44b2a50819700a159313d80ed2b0063202771 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sat, 27 Jan 2018 23:21:04 +0000 Subject: [PATCH] Unlink messages pot first before generating a new one in translation update --- webapp/bin/tr_update.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/bin/tr_update.py b/webapp/bin/tr_update.py index cb9d5f3..140eb22 100755 --- a/webapp/bin/tr_update.py +++ b/webapp/bin/tr_update.py @@ -5,6 +5,9 @@ if sys.platform == 'win32': pybabel = 'flask\\Scripts\\pybabel' else: pybabel = 'pybabel' +try: + os.unlink('titanembeds/translations/messages.pot') +except: + pass os.system(pybabel + ' extract -F babel.cfg -k lazy_gettext -o titanembeds/translations/messages.pot titanembeds') -os.system(pybabel + ' update -i messages.pot -d titanembeds/translations') -os.unlink('messages.pot') \ No newline at end of file +os.system(pybabel + ' update -i messages.pot -d titanembeds/translations') \ No newline at end of file