# HG changeset patch # User palgarvio # Date 1180634681 0 # Node ID ddfac856c34fc0bfe78e8d7856997542bcd8f714 # Parent 2fdc2b5003474971a45c78cb2f9896aec4c1d243 Change pot header's first line, "Translations Template for %%(project)s." instead of "SOME DESCRIPTIVE TITLE.". '''`project`''' and '''`version`''' now default to '''PROJECT''' and '''VERSION''' respectively. Fixed a bug regarding '''Content-Transfer-Encoding''', it shouldn't be the charset, and we're defaulting to `8bit` untill someone complains. diff --git a/babel/catalog/pofile.py b/babel/catalog/pofile.py --- a/babel/catalog/pofile.py +++ b/babel/catalog/pofile.py @@ -33,7 +33,7 @@ __all__ = ['escape', 'normalize', 'read_po', 'write_po'] POT_HEADER = """\ -# SOME DESCRIPTIVE TITLE. +# Translations Template for %%(project)s. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR , YEAR. # @@ -46,7 +46,7 @@ "Language-Team: LANGUAGE \\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 @@ -118,7 +118,7 @@ ... #, fuzzy, python-format ... msgid "foo %(name)s" ... msgstr "" - ... + ... ... #: main.py:3 ... msgid "bar" ... msgid_plural "baz" @@ -195,8 +195,8 @@ 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.