summaryrefslogtreecommitdiff
path: root/Lib/gettext.py
Commit message (Collapse)AuthorAgeFilesLines
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-2/+2
| | | | (Rough first cut.)
* Patch #1349274: gettext.install() now optionally installs additionalGeorg Brandl2006-02-191-3/+13
| | | | translation functions other than _() in the builtin namespace.
* Use cStringIO where available.Raymond Hettinger2004-12-311-1/+4
|
* This change implements the following gettext features, asGustavo Niemeyer2004-07-221-10/+95
| | | | | | | | | | | | | | | | | | | | 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.
* Replace str.find()!=1 with the more readable "in" operator.Raymond Hettinger2004-05-041-1/+1
|
* GNUTranslations._parse(): Initialize local variable k so that if theBarry Warsaw2003-10-041-1/+1
| | | | | | | first line of a header section isn't an RFC-ish header, it's just ignored instead of throwing an UnboundLocalError. Backport candidate.
* GNUTranslations._parse(): Fix SF bug #658233, where continuation linesBarry Warsaw2003-05-201-4/+9
| | | | | | in .po metadata caused a crash. Backport candidate.
* GNUTranslations:Barry Warsaw2003-04-241-33/+33
| | | | | | | | | | | | | | __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.
* NullTranslations.__init__(): Back out of setting the default charsetBarry Warsaw2003-04-111-16/+16
| | | | | | | | | | | | 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.
* From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.htmlBarry Warsaw2003-04-111-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* Patch #700839: Fix bugs in the plural handling.Martin v. Löwis2003-03-101-8/+17
|
* Patch #633547: Support plural forms. Do TODOs in test suite.Martin v. Löwis2002-11-211-5/+135
|
* Patch by Tim to shut up the compiler's DeprecationWarnings on theBarry Warsaw2002-08-141-18/+9
| | | | high-bit-set hex constants.
* Replace boolean test with is NoneRaymond Hettinger2002-06-011-1/+1
|
* Add a per-message fallback mechanism for translations.Martin v. Löwis2002-01-111-13/+50
|
* Add fallback argument to translation(). Request fallbacks on install.Martin v. Löwis2002-01-111-2/+5
| | | | Fixes #500595.
* added a few more __all__ listsSkip Montanaro2001-01-231-0/+3
| | | | fixed typo in ihooks docstring
* Whitespace normalization.Tim Peters2001-01-141-7/+7
|
* find(): Application of (slightly modified) SF patch #101928 by UlfBarry Warsaw2000-10-161-4/+4
| | | | | | Betlehem, verified by Peter Funk. Fixes preservation of language search order lost due to use of dictionary keys instead of a list. Closes SF bug #116964.
* translation(): Minor optimization patch which avoids instantiating theBarry Warsaw2000-10-051-1/+5
| | | | default value's instance unless it's absolutely necessary.
* Repaired comment.Tim Peters2000-09-011-1/+1
|
* GNUTranslations._parse(): Fix portability problems on 64-bit machinesBarry Warsaw2000-08-311-5/+14
| | | | by masking all unsigned integers with 0xffffffff.
* GNUTranslations.BE_MAGIC: don't be so clever in calculating this fromBarry Warsaw2000-08-311-1/+1
| | | | LE_MAGIC; it breaks on Tru64.
* Finalize this module for Python 2.0 based on feedback and input fromBarry Warsaw2000-08-301-173/+140
| | | | | Martin von Loewis, Peter Funk, James Henstridge, Francois Pinard, and Marc-Andre Lemburg.
* _expand_lang(), _find(): Added support for unaliasing and expanded theBarry Warsaw2000-08-251-4/+53
| | | | | language found in the environment variable, contributed by James Henstridge.
* Group consensus is that supporting alternative locale categories isBarry Warsaw2000-08-251-21/+2
| | | | | useless. So the category argument on _find() is removed, as is the dcgettext() function.
* Initial revision of gettext support for Python. This will undergoBarry Warsaw2000-08-251-0/+288
some changes.