mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix build problems on windows
This commit is contained in:
parent
f53fc46c42
commit
b39538fbc8
@ -46,9 +46,9 @@ def main(args=sys.argv):
|
||||
print 'Creating translations template'
|
||||
pygettext(buf, ['-p', tdir]+files)
|
||||
src = buf.getvalue()
|
||||
template = tempfile.NamedTemporaryFile(suffix='.pot')
|
||||
template.write(src)
|
||||
template.flush()
|
||||
fd, fname = tempfile.mkstemp(suffix='.pot')
|
||||
os.write(fd,src)
|
||||
|
||||
translations = {}
|
||||
for tr in TRANSLATIONS:
|
||||
po = os.path.join(tdir, tr+'.po')
|
||||
@ -56,12 +56,14 @@ def main(args=sys.argv):
|
||||
open(po, 'wb').write(src.replace('LANGUAGE', tr))
|
||||
else:
|
||||
print 'Merging', os.path.basename(po)
|
||||
check_call('msgmerge -v -U -N --backup=none '+po + ' ' + template.name)
|
||||
check_call('msgmerge -v -U -N --backup=none '+po + ' ' + fname)
|
||||
buf = cStringIO.StringIO()
|
||||
print 'Compiling translations'
|
||||
msgfmt(buf, [po])
|
||||
translations[tr] = buf.getvalue()
|
||||
open(os.path.join(tdir, 'data.py'), 'wb').write('translations = '+repr(translations))
|
||||
os.close(fd)
|
||||
os.unlink(fname)
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user