<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython.git/Lib/gettext.py, branch v2.7</title>
<subtitle>
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/'/>
<entry>
<title>close file explicitly</title>
<updated>2009-05-10T01:38:02+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2009-05-10T01:38:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=92d128543971660fb8b6c15f5e4db18e1c381ffb'/>
<id>92d128543971660fb8b6c15f5e4db18e1c381ffb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Patch #1349274: gettext.install() now optionally installs additional</title>
<updated>2006-02-19T13:26:36+00:00</updated>
<author>
<name>Georg Brandl</name>
<email>georg@python.org</email>
</author>
<published>2006-02-19T13:26:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=2701d4394c154e60d6f285c040e97d967e437cfc'/>
<id>2701d4394c154e60d6f285c040e97d967e437cfc</id>
<content type='text'>
translation functions other than _() in the builtin namespace.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
translation functions other than _() in the builtin namespace.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use cStringIO where available.</title>
<updated>2004-12-31T19:15:26+00:00</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-12-31T19:15:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=29f9f307681081e4d1eedc507157bd3bc22c709a'/>
<id>29f9f307681081e4d1eedc507157bd3bc22c709a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>This change implements the following gettext features, as</title>
<updated>2004-07-22T18:44:01+00:00</updated>
<author>
<name>Gustavo Niemeyer</name>
<email>gustavo@niemeyer.net</email>
</author>
<published>2004-07-22T18:44:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=895b2faf57d64935616cb1e98919ca66cfa15604'/>
<id>895b2faf57d64935616cb1e98919ca66cfa15604</id>
<content type='text'>
discussed recently in python-dev:

In _locale module:

- bind_textdomain_codeset() binding

In gettext module:

- bind_textdomain_codeset() function
- lgettext(), lngettext(), ldgettext(), ldngettext(),
  which return translated strings encoded in
  preferred system encoding, if
  bind_textdomain_codeset() was not used.
- Added equivalent functionality in translate()
  function and catalog classes.

Every change was also documented.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
discussed recently in python-dev:

In _locale module:

- bind_textdomain_codeset() binding

In gettext module:

- bind_textdomain_codeset() function
- lgettext(), lngettext(), ldgettext(), ldngettext(),
  which return translated strings encoded in
  preferred system encoding, if
  bind_textdomain_codeset() was not used.
- Added equivalent functionality in translate()
  function and catalog classes.

Every change was also documented.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace str.find()!=1 with the more readable "in" operator.</title>
<updated>2004-05-04T09:21:43+00:00</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-05-04T09:21:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=3215dbb7e00c40db867c7d85945df59d5f34022a'/>
<id>3215dbb7e00c40db867c7d85945df59d5f34022a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>GNUTranslations._parse(): Initialize local variable k so that if the</title>
<updated>2003-10-04T02:28:31+00:00</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2003-10-04T02:28:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=531eac8c1dba98545b008c00e7344029591a701d'/>
<id>531eac8c1dba98545b008c00e7344029591a701d</id>
<content type='text'>
first line of a header section isn't an RFC-ish header, it's just
ignored instead of throwing an UnboundLocalError.

Backport candidate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
first line of a header section isn't an RFC-ish header, it's just
ignored instead of throwing an UnboundLocalError.

Backport candidate.
</pre>
</div>
</content>
</entry>
<entry>
<title>GNUTranslations._parse(): Fix SF bug #658233, where continuation lines</title>
<updated>2003-05-20T17:26:48+00:00</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2003-05-20T17:26:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=3fcd9425651370b9938d8803f607cf15e60c5fe7'/>
<id>3fcd9425651370b9938d8803f607cf15e60c5fe7</id>
<content type='text'>
in .po metadata caused a crash.

Backport candidate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in .po metadata caused a crash.

Backport candidate.
</pre>
</div>
</content>
</entry>
<entry>
<title>GNUTranslations:</title>
<updated>2003-04-24T18:13:39+00:00</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2003-04-24T18:13:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=b8019887971a0859254b3e344c7052c9f874b18a'/>
<id>b8019887971a0859254b3e344c7052c9f874b18a</id>
<content type='text'>
    __init__(): Removed since we no longer need the coerce flag.
    Message ids and strings are now always coerced to Unicode, /if/
    the catalog specified a charset parameter.

    gettext(), ngettext(): Since the message strings are Unicodes in
    the catalog, coerce back to encoded 8-bit strings on return.

    ugettext(), ungettext(): Coerce the message ids to Unicode when
    there's no entry for the id in the catalog.

Minor code cleanups; use booleans where appropriate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    __init__(): Removed since we no longer need the coerce flag.
    Message ids and strings are now always coerced to Unicode, /if/
    the catalog specified a charset parameter.

    gettext(), ngettext(): Since the message strings are Unicodes in
    the catalog, coerce back to encoded 8-bit strings on return.

    ugettext(), ungettext(): Coerce the message ids to Unicode when
    there's no entry for the id in the catalog.

Minor code cleanups; use booleans where appropriate.
</pre>
</div>
</content>
</entry>
<entry>
<title>NullTranslations.__init__(): Back out of setting the default charset</title>
<updated>2003-04-11T20:26:47+00:00</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2003-04-11T20:26:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=ed060ec90ba3bf7b55eba01c627569c27ba279aa'/>
<id>ed060ec90ba3bf7b55eba01c627569c27ba279aa</id>
<content type='text'>
to iso-8859-1.

GNUTranslations._parse(): Back out the addition of a test for
Project-ID-Version in the metadata.  This was deliberately removed in
response to SF patch #700839.

Also, re-organize the code in _parse() so we parse the metadata header
containing the charset parameter before we try to decode any strings
using charset.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to iso-8859-1.

GNUTranslations._parse(): Back out the addition of a test for
Project-ID-Version in the metadata.  This was deliberately removed in
response to SF patch #700839.

Also, re-organize the code in _parse() so we parse the metadata header
containing the charset parameter before we try to decode any strings
using charset.
</pre>
</div>
</content>
</entry>
<entry>
<title>From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.html</title>
<updated>2003-04-11T18:36:43+00:00</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2003-04-11T18:36:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython.git/commit/?id=6a80f4e7d48ad99c08fd04fa09997a2a476db36c'/>
<id>6a80f4e7d48ad99c08fd04fa09997a2a476db36c</id>
<content type='text'>
- Expose NullTranslations and GNUTranslations to __all__

- Set the default charset to iso-8859-1.  It used to be None, which
would cause problems with .ugettext() if the file had no charset
parameter.  Arguably, the po/mo file would be broken, but I still think
iso-8859-1 is a reasonable default.

- Add a "coerce" default argument to GNUTranslations's constructor.  The
reason for this is that in Zope, we want all msgids and msgstrs to be
Unicode.  For the latter, we could use .ugettext() but there isn't
currently a mechanism for Unicode-ifying msgids.

The plan then is that the charset parameter specifies the encoding for
both the msgids and msgstrs, and both are decoded to Unicode when read.
For example, we might encode po files with utf-8. I think the GNU
gettext tools don't care.

Since this could potentially break code [*] that wants to use the
encoded interface .gettext(), the constructor flag is added, defaulting
to False.  Most code I suspect will want to set this to True and use
.ugettext().

- A few other minor changes from the Zope project, including asserting
that a zero-length msgid must have a Project-ID-Version header for it to
be counted as the metadata record.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Expose NullTranslations and GNUTranslations to __all__

- Set the default charset to iso-8859-1.  It used to be None, which
would cause problems with .ugettext() if the file had no charset
parameter.  Arguably, the po/mo file would be broken, but I still think
iso-8859-1 is a reasonable default.

- Add a "coerce" default argument to GNUTranslations's constructor.  The
reason for this is that in Zope, we want all msgids and msgstrs to be
Unicode.  For the latter, we could use .ugettext() but there isn't
currently a mechanism for Unicode-ifying msgids.

The plan then is that the charset parameter specifies the encoding for
both the msgids and msgstrs, and both are decoded to Unicode when read.
For example, we might encode po files with utf-8. I think the GNU
gettext tools don't care.

Since this could potentially break code [*] that wants to use the
encoded interface .gettext(), the constructor flag is added, defaulting
to False.  Most code I suspect will want to set this to True and use
.ugettext().

- A few other minor changes from the Zope project, including asserting
that a zero-length msgid must have a Project-ID-Version header for it to
be counted as the metadata record.
</pre>
</div>
</content>
</entry>
</feed>
