__all__ = ['escape', 'normalize', 'read_po', 'write_po']
POT_HEADER = """\
-# SOME DESCRIPTIVE TITLE.
+# Translations Template for %%(project)s.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
"Language-Team: LANGUAGE <LL@li.org>\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=%%(charset)s\\n"
-"Content-Transfer-Encoding: %%(charset)s\\n"
+"Content-Transfer-Encoding: 8bit\\n"
"Generated-By: Babel %s\\n"
""" % VERSION
... #, fuzzy, python-format
... msgid "foo %(name)s"
... msgstr ""
- ...
+ ...
... #: main.py:3
... msgid "bar"
... msgid_plural "baz"
if messages:
yield pack()
-def write_po(fileobj, messages, project=None, version=None, charset='utf-8',
- no_location=False, omit_header=False):
+def write_po(fileobj, messages, project='PROJECT', version='VERSION',
+ charset='utf-8', no_location=False, omit_header=False):
r"""Write a ``gettext`` PO (portable object) file to the given file-like
object.