Commits

Anonymous committed de31798

Monkey patch .gettext with .ugettext if possible (we use python 2.x)

  • Participants
  • Parent commits cdeb350

Comments (0)

Files changed (2)

File sphinx/environment.py

         for node, msg in extract_messages(self.document):
             ctx = node.parent
             patch = new_document(source, settings)
-            msgstr = catalog.ugettext(msg)
+            msgstr = catalog.gettext(msg)
             #XXX add marker to untranslated parts
             if not msgstr or msgstr == msg: # as-of-yet untranslated
                 continue

File sphinx/locale/__init__.py

         translator = gettext.NullTranslations()
         has_translation = False
     translators[catalog] = translator
+    if hasattr(translator, 'ugettext'):
+        translator.gettext = translator.ugettext
     return translator, has_translation