Unlink messages pot first before generating a new one in translation update

This commit is contained in:
Jeremy Zhang 2018-01-27 23:21:04 +00:00
parent 1e66335fee
commit 44f44b2a50

View File

@ -5,6 +5,9 @@ if sys.platform == 'win32':
pybabel = 'flask\\Scripts\\pybabel' pybabel = 'flask\\Scripts\\pybabel'
else: else:
pybabel = 'pybabel' 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 + ' extract -F babel.cfg -k lazy_gettext -o titanembeds/translations/messages.pot titanembeds')
os.system(pybabel + ' update -i messages.pot -d titanembeds/translations') os.system(pybabel + ' update -i messages.pot -d titanembeds/translations')
os.unlink('messages.pot')