1. mbrochh
  2. sphinx

Commits

Robert Lehmann  committed c4b4a68

Move POT-Creation-Date configuration value back into code.

  • Participants
  • Parent commits 88f1c69
  • Branches default

Comments (0)

Files changed (2)

File sphinx/builders/intl.py

View file
  • Ignore whitespace
 """
 
 import collections
+from datetime import datetime
 from os import path
 
 from docutils import nodes
 msgstr ""
 "Project-Id-Version: %(version)s\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: %(gettext_ctime)s\n"
+"POT-Creation-Date: %(ctime)s\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
                 catalog.append(msg)
 
     def finish(self):
+        data = dict(
+            version = self.config.version,
+            copyright = self.config.copyright,
+            project = self.config.project,
+            # XXX should supply tz
+            ctime = datetime.now().strftime('%Y-%m-%d %H:%M%z'),
+        )
         for section, messages in self.status_iterator(
                 self.catalogs.iteritems(), "writing message catalogs... ",
                 lambda (section, _):darkgreen(section), len(self.catalogs)):
+
             pofile = open(path.join(self.outdir, '%s.pot' % section), 'w')
             try:
-                pofile.write(POHEADER % self.config)
+                pofile.write(POHEADER % data)
                 for message in messages:
                     # message contains *one* line of text ready for translation
                     message = message.replace(u'\\', ur'\\').replace(u'"', ur'\"')

File sphinx/config.py

View file
  • Ignore whitespace
 
 import os
 import re
-from datetime import datetime
 from os import path
 
 from sphinx.errors import ConfigError
 
         # manpage options
         man_pages = ([], None),
-
-        # gettext options
-        gettext_ctime = (lambda self:datetime.now() # should supply tz
-                                     .strftime('%Y-%m-%d %H:%M%z'),
-                         'gettext'),
     )
 
     def __init__(self, dirname, filename, overrides, tags):