2017-11-16 04:37:21 +01:00
|
|
|
#!/usr/bin/python3
|
2017-11-16 04:09:53 +01:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
pybabel = 'flask\\Scripts\\pybabel'
|
|
|
|
else:
|
|
|
|
pybabel = 'pybabel'
|
|
|
|
if len(sys.argv) != 2:
|
|
|
|
print("usage: tr_init <language-code>")
|
|
|
|
sys.exit(1)
|
2018-01-27 21:47:58 +01:00
|
|
|
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 + ' init -i titanembeds/translations/messages.pot -d titanembeds/translations -l ' + sys.argv[1])
|