Changeset 7473
- Timestamp:
- 04/26/08 08:25:30 (2 months ago)
- Files:
-
- django/trunk/django/bin/make-messages.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/bin/make-messages.py
r6445 r7473 86 86 open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) 87 87 thefile = '%s.py' % file 88 cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( 89 os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) 88 cmd = 'xgettext -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (domain, os.path.join(dirpath, thefile)) 90 89 (stdin, stdout, stderr) = os.popen3(cmd, 't') 91 90 msgs = stdout.read() … … 98 97 new = '#: '+os.path.join(dirpath, file)[2:] 99 98 msgs = msgs.replace(old, new) 99 if os.path.exists(potfile): 100 # Strip the header 101 msgs = '\n'.join(dropwhile(len, msgs.split('\n'))) 102 else: 103 msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8') 100 104 if msgs: 101 105 open(potfile, 'ab').write(msgs)
