Files
pyfa/scripts/compile_lang.py
2020-07-24 21:59:38 -04:00

15 lines
402 B
Python

import os, glob
import msgfmt
import config
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
locale_path = os.path.abspath(os.path.join(script_dir, '..', 'locale'))
for name in glob.iglob(locale_path + '/**'):
if not os.path.isfile(name):
path = os.path.join(locale_path, name, 'LC_MESSAGES', config.CATALOG)
sys.argv[1:] = [path + '.po']
msgfmt.main()